Reputation: 31
We are using serverless-webpack at my company, and we're planning to upgrade from Serverless Framework v3.39 to v4.4.6. (The motivation for this upgrade is outside the scope of this question.)
According to the Serverless website, v4 includes native TypeScript support with ESBuild, and plugins that bundle code, such as serverless-webpack, need to be disabled unless we opt out of the default build process. The relevant documentation can be found here.
Which I intended to do by adding build: esbuild: false
in my serverless.yml like they mention on their build configuration page.
I want to continue using the serverless-webpack plugin by opting out of the default build process, but when I try to install the plugin with Serverless v4, I receive an error indicating compatibility issues:
npm install serverless-webpack @latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/serverless
npm ERR! serverless@"^4.4.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer serverless@"1 || 2 || 3" from [email protected]
npm ERR! node_modules/serverless-webpack
npm ERR! dev serverless-webpack@"^5.14.2" from the root project
I've reviewed the plugin page on npm, but I don't see any clear indications that the plugin is incompatible with Serverless v4. I also tried using --force and --legacy-peer-deps flags during installation, but I don't want to rely on this since I have little knowledge of unattended consequence to force things like these.
Question:
Any help and guidance would be appreciated!
What I have tried:
npm install serverless-webpack@latest --legacy-peer-deps
This was successful meaning: 1- The command ran successfully while warning me on conflicting dependencies 2- I can run serverless deploy and deploy my lambdas to my AWS tenant
npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/serverless
npm WARN serverless@"^4.4.6" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/serverless
npm WARN peer serverless@"1 || 2 || 3" from [email protected]
npm WARN node_modules/serverless-webpack
npm WARN dev serverless-webpack@"^5.14.2" from the root project
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/serverless
npm WARN peer serverless@"1 || 2 || 3" from [email protected]
npm WARN node_modules/serverless-webpack
npm WARN dev serverless-webpack@"^5.14.2" from the root project
2- Consult Documentation: Review the documentation for serverless-webpack to see if there are any specific instructions or compatibility notes regarding serverless version 4.x.
I did not see anything related to incompatibilites.
Upvotes: 3
Views: 209