GithubHelp home page GithubHelp logo

Comments (7)

garethmcc avatar garethmcc commented on June 27, 2024

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.

kdybicz avatar kdybicz commented on June 27, 2024

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.

Mmarzex avatar Mmarzex commented on June 27, 2024

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.

kdybicz avatar kdybicz commented on June 27, 2024

@Mmarzex well, I guess I would like this module to be included instead :)

from serverless.

Mmarzex avatar Mmarzex commented on June 27, 2024

@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.

kdybicz avatar kdybicz commented on June 27, 2024

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.

kdybicz avatar kdybicz commented on June 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.