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

prevents js updates with mini-css-extract-plugin and HMR #677

Open
cahnory opened this issue Feb 4, 2021 · 0 comments
Open

prevents js updates with mini-css-extract-plugin and HMR #677

cahnory opened this issue Feb 4, 2021 · 0 comments

Comments

@cahnory
Copy link

cahnory commented Feb 4, 2021

  • Operating System: macOS Catalina
  • Node: 12.10.0
  • Webpack: 5.20.0
  • Astroturf: 1.0.0-beta.16
  • mini-css-extract-plugin: 1.3.2

First, I'm not sure that astroturf is the root of the issue or just a trigger as both Astroturf and mini-css-extract-plugin seem to work independently. I can make a repro repos but as I know not all known issue with v1 are listed, I didn't want to make it before I'm sure it's a new one.

Actual Behavior

My React component is not always updated by HMR when the file contains astroturf css.

Expected behavior

My React component should always be updated by HMR.

Observations

  • the style seems to always be updated
  • when a javascript file importing css file changes, HMR has a single module to update (the js):
    ["3027"]
  • when a javascript file containing astroturf css changes, HMR has two modules to update (the generated css and the js even if the css didn't change):
    ["194", 3027]
  • it seems that when my component is updated (I see the changes in the browser), the two module update (css, js modules ids) is preceded by a single module update (js module id):
    ["3027"] then ["194", 3027]
  • when there is a two module update (astroturf css and the js declaring it), the js module id is a number and not a string (see above)
  • using HashedModuleIdsPlugin to only have string id didn't fix anything
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

1 participant