Skip to content

ramasilveyra/bug-repro-next-w5-inline-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bug repro of next.js issue with webpack 5 inlined and worker-loader

Background

  1. Next v10.0.6 inlined webpack vercel/next.js#20598.
  2. worker-loader has webpack as peer dep https://github.com/webpack-contrib/worker-loader/blob/v3.0.7/package.json#L40-L42.
  3. worker-loader imports webpack https://github.com/webpack-contrib/worker-loader/blob/v3.0.7/src/index.js#L6-L35.
  4. webpack 5 doesn't support multiple versions installed jantimon/html-webpack-plugin#1451 (comment)

Bug repro

When using next.js with webpack 5 inlined and worker-loader an exception appears.

  1. yarn
  2. yarn build
  3. Desired behaviour: build to succeed.
  4. Current behaviour: exception
➜  bug-repro-next-w5-inline-worker git:(main) ✗ yarn build
yarn run v1.22.5
$ next build
info  - Creating an optimized production build
Failed to compile.

./lib/hello.worker.js
TypeError: Cannot read property 'version' of undefined


> Build error occurred
Error: > Build failed because of webpack errors
    at /Users/ramirosilveyra/dev/personal/bug-repro-next-w5-inline-worker/node_modules/next/dist/build/index.js:15:918
    at async /Users/ramirosilveyra/dev/personal/bug-repro-next-w5-inline-worker/node_modules/next/dist/build/tracer.js:1:1450
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published