serverless-bundle
serverless-bundle copied to clipboard
Webpack error when using v5.0.0
`WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module.rules[1].resolve has an unknown property 'fullySpecified'. These properties are valid: object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, concord?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, ignoreRootsErrors?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, preferAbsolute?, resolver?, roots?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }`
serverless offline won't start because of this error
My quick fix was to comment out the following inside src/webpack.config.js What would be a final fix? Thanks
// { // test: /\.mjs$/, // include: /node_modules/, // type: "javascript/auto", // resolve: { // fullySpecified: false, // }, // },
Went back to v4.4.0 due to this issue. Even if I can make it work locally using the hack mentioned above, the CI/CD doesn't like it.
Thanks Bernie! Any news on fixing this without downgrading?
I might be mistaken but this was fixed in: https://github.com/AnomalyInnovations/serverless-bundle/releases/tag/v5.0.2
Thanks @jayair I'll take a look and close the ticket if it's the case
@jayair no, still the same issue after upgrading to 5.0.2
`Serverless: Bundling with Webpack...
Webpack Options Validation Error ------------------------
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module.rules[1].resolve has an unknown property 'fullySpecified'. These properties are valid: object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, concord?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, ignoreRootsErrors?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, preferAbsolute?, resolver?, roots?, symlinks?, unsafeCache?, useSyncFileSystemCalls? } -> Options for the resolver at webpack (/Users/alex/Projects/serverless-project/node_modules/webpack/lib/webpack.js:31:9)`
@jayair not sure if it helps
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 16.13.0
Framework Version: 2.64.1 (local)
Plugin Version: 5.5.0
SDK Version: 4.3.0
Components Version: 3.17.1
Same here
This issue is not related the the one fixed in 5.0.2. I think the solution for this case is to use enforceExtension instead of using fullySpecified
here
@ghostnumber7 Oh I see. Feel free to submit a PR with a test case and I'll merge it. Thanks!
After some more digging, it seams that fullySpecified
was added here on July 17 (and can't see exactly which version does have it for the first time). Maybe updating webpack version would do the trick (was wrong in the previous comment). Configuration does exist, so only thing I can think of is having an old version of webpack that matches the version we specify but does not have that property
Any news? Don't mean to be pushy but this issue has been opened in August and hasn't been resolved. The issue is still happening with the latest version 5.2.0. Thanks
I haven't had a chance to dig into this. Feel free to open a PR with a fix and I'll take a look right away.
I totally gave up on updating this library. It does not work properly since 5.0.
I started a new project and started digging a little more through my base files.
I might have been resolved this issue by doing:
npm list webpack
npm remove cache-loader
Basically, npm list webpack will list the versions of webpack used by the project. Another version of webpack was installed for cache-loader and was probably conflicting with the one used by serverless-bundle
I'm now able to use serverless-bundle 5.3.0
hey, so, just found this project. seems like it's currently broken? nobody answered this so question either...
I'll just downgrade to 4.x I guess. It's a shame that this simple webpack flag seems to be impossible to add.
Please feel free to open a PR!
In the docs you specifically say that you believe all webpack configs are covered and if anything's missing just to create a github issue 😅
this has been open for 7 months now. I agree, I should just open the PR myself, but I sadly don't have the time. will have to stick to 4.x for now :(
@jayair if I were to create a PR it would be for the missing functionality to override forceExclude. bc some layers (see https://github.com/fusebit/everynode/issues/3 ) don't have the SDK included
Yeah if the PR describes what the fix is and has some tests that would be great.
@jayair @yspreen please refer to the solution I used to fix the issue on my end. You might be able to do something similar. If not feel free to open a PR https://github.com/AnomalyInnovations/serverless-bundle/issues/259#issuecomment-1043621908