Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default of forceExclude is broken from Lambda with Node.js 18 runtime #361

Open
laurentperroteau opened this issue Jul 14, 2023 · 3 comments

Comments

@laurentperroteau
Copy link

What is the problem ?

Using Node.js 18 and AWS SDK v3 significantly increases lambda size with defaults of serverless-bundle

Details :

From Node.js 18, the Lambda runtime layer include aws-sdk-js-v3 and the default forceExclude: [ 'aws-sdk'] is not working any more and should be replacer by the v3 package...

... but v3 is modular, and it's not possible to list the hundreds of packages. And because serverless-webpack do not allow regex or glob pattern, there is no workaround! On the other hand, it would be possible at least to prevent (see my PR).

Note: Personally, because I didn't know who excluded the "aws-sdk", it took me more than a day to solve the problem (first I searched for hours in the docs AWS, after in the Serverless docs and I finally found out it was serverless-bundle)

@jayair
Copy link
Member

jayair commented Jul 14, 2023

I see yeah. This has changed. We should remove that exclude part from the code instead. Would appreciate a PR on that!

@laurentperroteau
Copy link
Author

I would do a PR with pleasure, but I don't know how to solve the problem because serverless-webpack do not allow regex or glob pattern! I try only @aws-sdk but it doesn't work. You should list all the packages and they are hundreds.

@Dmtreaqq
Copy link

Dmtreaqq commented May 7, 2024

Any updates on this ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants