-
-
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
HMR with chunk splitting fails to reload the modified chunk if it’s not the last #730
Comments
Works fine, can't reproduce, update webpack to the latest version |
Feel free to feedback |
Interesting. I didn’t think to try multiple browsers before, but I tried it in Chrome and both chunks can be updated as expected. In Firefox, only the last chunk can be updated. Same result after updating css-loader 5.1.3 → 5.2.0, mini-css-extract-plugin 1.3.9 → 1.4.0, webpack 5.27.2 → 5.28.0. (Just pushed these updates to the Gist.) I reproduced in a freshly created Firefox profile to rule out problems with Firefox configuration or extensions, and in both Firefox 87 and yesterday’s nightly to rule out problems with a specific Firefox version. Can you try reproducing in Firefox? |
Yes you are right, it is duplicate #444, we can't find your |
Expected Behavior
Hot module reload should work with all CSS chunks.
Actual Behavior
When there are multiple CSS chunks due to
optimization.splitChunks
, hot module reload only works with the last CSS chunk.Code
https://gist.github.com/andersk/2d45d4363478b22e998e177836ebce12
How Do We Reproduce?
git clone https://gist.github.com/andersk/2d45d4363478b22e998e177836ebce12 css-hmr-test cd css-hmr-test npm install npx webpack serve --hot
foo.css
, e.g. by changinggreen
toblue
, and see that the change is applied in the browser immediately.common.css
, e.g. by changinggreen
toblue
, and see that the change is not applied.In the browser console, you can see that the wrong chunk has been reloaded:
This may be the same as one of the issues reported in #444. If so, consider this to be a minimal reproducible test case as requested there.
The text was updated successfully, but these errors were encountered: