-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
LoadableReady not be called if required chunks have a chunk only contains css. #688
Comments
Hey @jas0ncn 👋, |
😨 we rely on Another option - is to detect and ignore such chunks on the clientside, as they are expected to be added into HTML output during SSR. That probably would work... |
Thanks responded! The second option sounds good, the easy way to fix this issue. |
The issue will only occur when build by webpack v5. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
🐛 Bug Report
If webpack generates a chunk only contains css file, no js, loadable ready check will fail, and callback function not be called.
loadable-components/packages/component/src/loadableReady.js
Lines 56 to 67 in dde2252
To Reproduce
create a new react webpack project, just simple import css in components, add
mini-css-extract-plugin
to webpack config, insure pack a chunk only contains css file.Expected behavior
Filter out the chunk only contains css file when generating
RequiredChunksScriptTag
:loadable-components/packages/server/src/ChunkExtractor.js
Lines 282 to 284 in dde2252
Issues without a reproduction link are likely to stall.
Run
npx envinfo --system --binaries --npmPackages @loadable/component,@loadable/server,@loadable/webpack-plugin,@loadable/babel-plugin --markdown --clipboard
Paste the results here:
The text was updated successfully, but these errors were encountered: