-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
MiniCssExtractPlugin tries and crashes on CSS injection in Web Workers #1001
Comments
Or we may need a way to totally disable MiniCss over some top level files (worker files) |
Yeah, it is a bug/limitation, just for imformation - why do you import CSS in web workers? |
In fact I import a constant from a 3rd part graphic module. But when you do
Webpack process the full module (in dev mode) without tree shaking) and automatically the css of the module is caught. This is perhaps another issue, but at least the NPE of document might be treat |
Got it, let's to do nothing in CSS runtime when no document, it should be easy to fix, do you want to send a PR? |
I will not have time for this sorry 😔 |
Don't worry, just a question, I will put it in my TODO list |
@paztis Hello, can you provide webpack version? I tried to reproduce on the latest version and got |
Because maybe you have |
No. This code is explicitly yours. I use latest webpack version + webpack federation |
Yeah, but HMR has |
Reproduced, looks like you have it in |
Bug report
Actual Behavior
In Web Worker, when we try to import files that are also used into main frame , MiniCss frequently tries to inject CSS stylesheets
As document is not available inside Web Worker, it crashes (no existence check)
Expected Behavior
Document existence must be checked before injection test.
How Do We Reproduce?
Create a simple webworker as specified in https://webpack.js.org/guides/web-workers/
Try to import file taht contains CSS to check the crash
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: