extract-css-chunks-webpack-plugin
extract-css-chunks-webpack-plugin copied to clipboard
bug: fails to find `bestMatch` under some situations
bestMatch
is not always located before this branch is triggered.
As a result, there's a Cannot read property 'pop' of undefined
error fired.
Here's a really small project that reproduces the issue: https://github.com/Timer/extract-css-chunks-webpack-plugin-bug
This same exact input works with mini-css-extract-plugin
, so it might be worth finding where logic diverges!
Node: v12.14.1
extract-css-chunks-webpack-plugin
: 4.7.4
hmm okay. Ill re-sync with mini-css i have a PR open to that project anyways
So the version in your repo you made was an older one. Either way im not able to replicate this
Are you sure youre using the latest copy? These projects are nearly the same at the moment
this syncs it with mini-css and my performance improvement made (currently open pr) https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/pull/226/files
perhaps rm -rf node_moduels, yarn cache clean, yarn --force
So the version in your repo you made was an older one. Either way im not able to replicate this
Are you sure youre using the latest copy? These projects are nearly the same at the moment
Positive! See the yarn.lock
file which has resolved to 4.7.4
:
https://github.com/Timer/extract-css-chunks-webpack-plugin-bug/blob/448c3b4974790c1e2c542f27525b49eacbcee083/yarn.lock#L2612-L2613
I went ahead and explicitly upgraded the package to remove doubts: https://github.com/Timer/extract-css-chunks-webpack-plugin-bug/commit/39a5cb8b150b51577f5dfa32a5be2cc147867476
āÆ rm -rf node_modules && git rev-parse HEAD && yarn install && yarn why extract-css-chunks-webpack-plugin && yarn next build
39a5cb8b150b51577f5dfa32a5be2cc147867476
yarn install v1.21.1
[1/4] š Resolving packages...
[2/4] š Fetching packages...
[3/4] š Linking dependencies...
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning " > [email protected]" has unmet peer dependency "webpack@^4.4.0 || ^5.0.0".
warning "extract-css-chunks-webpack-plugin > [email protected]" has unmet peer dependency "webpack@^4.40.2".
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0".
[4/4] šØ Building fresh packages...
āØ Done in 9.55s.
yarn why v1.21.1
[1/4] š¤ Why do we have the module "extract-css-chunks-webpack-plugin"...?
[2/4] š Initialising dependency graph...
[3/4] š Finding dependency...
[4/4] š” Calculating file sizes...
=> Found "[email protected]"
info Has been hoisted to "extract-css-chunks-webpack-plugin"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "140KB"
info Disk size with unique dependencies: "732KB"
info Disk size with transitive dependencies: "6.02MB"
info Number of shared dependencies: 13
āØ Done in 0.57s.
yarn run v1.21.1
$ /Users/joe/Desktop/scratch/extract-css-chunks-webpack-plugin-bug/node_modules/.bin/next build
Warning: Production code optimization has been disabled in your project. Read more: https://err.sh/zeit/next.js/minification-disabled
Creating an optimized production build
Failed to compile.
chunk styles
static/css/19d7f5d5.chunk.css
Cannot read property 'pop' of undefined
> Build error occurred
Error: > Build failed because of webpack errors
at build (/Users/joe/Desktop/scratch/extract-css-chunks-webpack-plugin-bug/node_modules/next/dist/build/index.js:10:900)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Any plans to solve this problem?
The same problem for us. For now we downgrade to the version [email protected] and works good for now.
https://github.com/webpack-contrib/mini-css-extract-plugin/issues/341
Is anyone willing to open a PR if they have found the exact issue? @Timer is there anything I need to do on my side to patch this?
@ScriptedAlchemy we no longer use this plugin in Next.js, so I'm not sure.
The users who ran into this issue might know if it still reproduces: https://github.com/zeit/next.js/issues/10161
Booooo!
Haha all good. Iām maintaining mini-css more than this. Since I merged my hmr capabilities in, I only use this repo to test prereleases of mini css
please any news about this? because i still stuck on this issue