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

Unable to exclude aws-sdk from bundle #1222

Open
C5H8NNaO4 opened this issue Aug 20, 2022 · 5 comments
Open

Unable to exclude aws-sdk from bundle #1222

C5H8NNaO4 opened this issue Aug 20, 2022 · 5 comments
Labels
awaiting reply Awaiting for a reply from the OP

Comments

@C5H8NNaO4
Copy link

This is a (Bug Report / Feature Proposal)

Description

For bug reports:

  • The aws-sdk package gets bundled into the lambda.zip bundle
  • The aws-sdk should not be bundled
  • The config used is as follows:
webpack:
    webpackConfig: ./webpack.config.js
    includeModules:
        forceExclude:
            - aws-sdk
####
webpack:
    webpackConfig: ./webpack.config.js
    includeModules: true
    excludeFiles: node_modules/aws-sdk/**

The aws-sdk has also been added as an external in the webpack config.

However the aws-sdk is still being included in the bundle.

Running a script like rm node_modules/aws-sdk unfortunately throws an error. So I can't use that as a workaround.

Additional Data

  • Serverless-Webpack Version you're using: 5.8.0
  • Webpack version you're using: 5.74.0
  • Serverless Framework Version you're using: ??
  • Operating System: Windows
@vicary
Copy link
Member

vicary commented Aug 20, 2022

Would you mind try adding an exclude pattern in package?

serverless.yml

package:
  patterns:
    - '!node_modeuls/aws-sdk/**'

@vicary vicary added the awaiting reply Awaiting for a reply from the OP label Aug 20, 2022
@vicary
Copy link
Member

vicary commented Aug 20, 2022

Possible duplicate with #1218, see #1218 (comment) for unconfirmed workaround.

@C5H8NNaO4
Copy link
Author

C5H8NNaO4 commented Aug 20, 2022

@vicary I tried adding the exclude pattern in package but that doesn't change anything. I also saw the duplicate, but none of the suggested workarounds or solutions do help.

@vicary
Copy link
Member

vicary commented Aug 20, 2022

@C5H8NNaO4 Thanks, that's unfortunate. There are many possible ways to have this happening, usually due to misconfiguration and oversights.

If a minimum reproducting repo is possible, please try to make one so we could pin point the problem.

@andrew-ignatiev
Copy link

@C5H8NNaO4 try this #1218 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting reply Awaiting for a reply from the OP
Projects
None yet
Development

No branches or pull requests

3 participants