Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: fails to find bestMatch under some situations #222

Open
Timer opened this issue Jan 24, 2020 · 14 comments
Open

bug: fails to find bestMatch under some situations #222

Timer opened this issue Jan 24, 2020 · 14 comments

Comments

@Timer
Copy link

Timer commented Jan 24, 2020

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

@ScriptedAlchemy
Copy link
Collaborator

hmm okay. Ill re-sync with mini-css
i have a PR open to that project anyways

@ScriptedAlchemy
Copy link
Collaborator

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

@ScriptedAlchemy
Copy link
Collaborator

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

@ScriptedAlchemy
Copy link
Collaborator

perhaps rm -rf node_moduels, yarn cache clean, yarn --force

@Timer
Copy link
Author

Timer commented Jan 27, 2020

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

@Timer
Copy link
Author

Timer commented Jan 27, 2020

I went ahead and explicitly upgraded the package to remove doubts:
Timer/extract-css-chunks-webpack-plugin-bug@39a5cb8

@Timer
Copy link
Author

Timer commented Jan 27, 2020

❯ 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 " > css-loader@3.4.2" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning " > extract-css-chunks-webpack-plugin@4.7.4" has unmet peer dependency "webpack@^4.4.0 || ^5.0.0".
warning "extract-css-chunks-webpack-plugin > webpack-external-import@1.1.1" has unmet peer dependency "webpack@^4.40.2".
warning " > optimize-css-assets-webpack-plugin@5.0.3" 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 "extract-css-chunks-webpack-plugin@4.7.4"
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.

pavelzubov added a commit to GenesisVision/web-client that referenced this issue Feb 9, 2020
@pavelzubov
Copy link

Any plans to solve this problem?

@benitocas88
Copy link

The same problem for us. For now we downgrade to the version next@9.1.0 and works good for now.

@fivethreeo
Copy link

@ScriptedAlchemy
Copy link
Collaborator

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?

@Timer
Copy link
Author

Timer commented Apr 22, 2020

@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:
vercel/next.js#10161

@ScriptedAlchemy
Copy link
Collaborator

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

@ghost
Copy link

ghost commented Aug 17, 2020

please any news about this? because i still stuck on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants