Comments (8)
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.
Given that the original issue has been resolved, I'm going to close this out. Meanwhile we are going to review our docs about the external
behavior and make updates async.
from serverless.
Related Issues (20)
- Failed to construct URL with https://ssm.${param:region}.amazonaws.com TypeError: Invalid URL HOT 4
- Feature Request: AWS DynamoDB Accelerator (DAX) Support in Serverless Framework
- Allow Serverless Dev to work with Apollo Server AWS_PROXY integration. HOT 1
- AWS Lambda Python 3.9 and above
- Local invoke tries to pull images that are no longer supported. Swap to pulling from aws images insteadof lambci.
- "EMFILE: too many open files" while running serverless deploy on Windows HOT 4
- Build override package Pattern V4 HOT 4
- Serverless V4 esbuild not including files that are not mentioned in the serverless config like utils and helper files HOT 3
- v4 opt:region var default value not resolved on deploy HOT 5
- Temporary artifact source name collision HOT 3
- [V4] Parameters defined in global stages property not loading when used in custom property HOT 3
- env files not loading based on the stage HOT 3
- Serverless V4 `npm i` is not working after following CONTRIBUTING.md HOT 4
- Serverless V4 fails to resolve default when parameter is not found HOT 9
- Cannot Deploy Lambda Functions as Containers in China AWS -- Image.uri does not match pattern regex
- serverless deploy hangs when using `--verbose` and `disableRollback: true`
- LIft: `Provider construct is not supported` error HOT 2
- V4 cannot deploy using --package option if working directory absolute path doesn't exactly match directory where package --package command is run HOT 1
- Unable to find Route by key [request method] [route] within the provided RouteSettings
- `serverless deploy function` with a custom docker image fails
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.