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
Incorrect hash for dynamic CSS files not using contenthash, #17
Comments
This should be fixed now as long as you upgrade to the latest (0.4.4) mini-css-extract-plugin! |
Closing since you gave it a thumbs up - let me know if you're still hitting issues! |
Just tried with the new version of mini-css-extract-plugin and neither critters nor prerender-loader output any error but the referenced css file is still incorrect for dynamically imported modules. If I remove prerender-loader and just use Critters the following error is thrown: The css file referenced in the bundle under the comment After looking at the mini-css-extract-plugin source it seems they are handling hashes on the Edit: after debugging the reproduction repo I saw that mini-css-extract-plugin hooks are running twice, once before prerender-loader and once again inside (it is beign added to the new compiler plugins), and it seems different assets (with different names) are being generated on each compilation which seems normal since using Anyways I'm using |
Summarizing the previous comment: My guess is that since prerender-loader is creating a new compilation, when using a hash different from |
That makes sense. Perhaps it'd be worth having the plugin warn when |
Hi, when using
prerender-loader
in conjunction withmini-css-extract-plugin
there is an error loading CSS imported bydynamic-chunks
when the hashing strategy is different fromcontenthash
for that css file.In that case,
prerender-loader
outputs a link pointing to a CSS file with a different hash.Note that this doesn't apply to JS files nor to CSS files imported by the main (entrypoint) chunk.
A full reproduction is in https://github.com/isidrok/prerender-loader-reprod, look at the readme for more information.
The original discussion is in GoogleChromeLabs/critters#7
The text was updated successfully, but these errors were encountered: