Comments (7)
Thanks @kdybicz . One thing to mention is that 4.1.5 went out with some changes that may or may not have helped with this. If possible, could you confirm while we look into this.
To upgrade to 4.1.5 just run serverless command such as serverless --version
and it will auto upgrade
from serverless.
Hey @garethmcc! I'm afraid I don't see anything useful in the Changelog. I've tried again with include
and forceInclude
in the build.esbuild
for the sls 4.1.5, but it gave me the same error message:
✖ Build failed with 1 error:
/Users/kamil/.serverless/releases/4.1.5/package/node_modules/esbuild/lib/main.js:253:12: ERROR: Invalid option in build() call: "forceInclude"
ServerlessError2: Build failed with 1 error:
/Users/kamil/.serverless/releases/4.1.5/package/node_modules/esbuild/lib/main.js:253:12: ERROR: Invalid option in build() call: "forceInclude"
at Esbuild._build (file:///Users/kamil/.serverless/releases/4.1.5/package/dist/sf-core.js:1026:11533)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async before:package:createDeploymentArtifacts (file:///Users/kamil/.serverless/releases/4.1.5/package/dist/sf-core.js:1026:4371)
from serverless.
Hi @kdybicz , it sounds like what you are looking for is the external
property. Any npm modules you set there are not included and instead will be put in a node_modules
folder in the resulting zip file that gets uploaded to AWS.
from serverless.
@Mmarzex well, I guess I would like this module to be included instead :)
from serverless.
@kdybicz Included in what? If you want it included in the deployment package but not bundled you would use external
, which I believe is what you are asking for here from my understanding of forceInclude.
from serverless.
To make it clear, as the @keyv/redis
is more referenced in code directly, but is required for the code to work I needed to use:
custom:
webpack:
includeModules:
forceInclude:
- '@keyv/redis'
to be bundled at all: apollographql/apollo-server#6682 (comment)
I will test the external
later Today and let you know if that has solved my issue.
from serverless.
@Mmarzex looks like external
did the trick, though I must say that this behavior wasn't clear at all when looking at the documentation:
# NPM packages to not be bundled
external:
- @aws-sdk/client-s3
I appreciate your help!
from serverless.
Related Issues (20)
- Serverless 4.x doesn't seem to update or work HOT 7
- sls deploy issue HOT 1
- Make inputTransformers and inputPath available when CfnRule target is event bus HOT 1
- Invalid option in build call buildConcurrency HOT 1
- [v4] Parsing issue around build.esbuild.exclude and build.esbuild.external HOT 1
- Dev command does not work when custom IAM role set HOT 3
- AWS SSO doesn't seem to work with SERVERLESS_LICENSE_KEY HOT 4
- [windows][v4] serverless invoke local is failing to load handlers HOT 3
- Params top-level property is not loading when defined in a file HOT 3
- Detected unrecognized CLI options: "--d".
- V4: serverless dev command does not work in eu-south-1 region. HOT 3
- V4: .env variables do not work in serverles.yml HOT 1
- V4: Default deploymentMethod 'direct' or 'changesets'
- [v4] Unable to use basic cli functionality like help without aws credentials HOT 3
- Custom resource uses wrong datatype for version
- existing:true S3 Bucket Still Tries to get deleted
- `logs.restApi: true` fails to deploy HOT 1
- Serverless deploy not working
- [Serverless V4] The "exclude" keyword doesn't work for esbuild HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless.