Reproduction for an issue in prerender-loader when loading css stylesheets imported by dynamic chunks.
Issues:
There is an error when using mini-css-extract-plugin
in conjunction with prerender-loader
and code-splitting.
Depending on the hash strategy, prerender-loader
may inject non existent css files into the generated html, but this only happens when the css is imported by dynamic chunks.
-
Run
npm i
. -
Run
npm start
and verify that everything works just fine, you must see two redindex
, two greenstatic
a bluedynamic
. -
Open webpack.config.js and replace:
const HASH = 'contenthash';
by
const HASH = 'hash';
Run
npm start
again and verify that thedynamic.xxx.css
file that is being loaded has a different name that the one indist
.Go to the browser now, you will see in the network that
Webpack
is loading the correct file at runtime but that there is a 404 for the inlined file. -
If you want to check
Critters
behavior open Webpack configuration file again and uncommentnew Critters()
.If you run
npm start
you will see an error generated byCritters
in the console and indist/index.html
content.