If we have a link in document which its href attribute is in data url form, reloadStyle() function shouldn't select and parse it. For example:
<link rel="shortcut icon" href="data:;base64,=">
reloadStyle() function will select this link element and try to parse its href, then throws an error from getReloadUrl() function.
Uncaught TypeError: Failed to construct 'URL': Invalid URL
no need?
Add the link mentioned above to any html template.
/cc @ScriptedAlchemy I think it is easy to fix
Looking into it now, hope to have PR ready soon. This weekend is a little busy
@hsxfjames do you want to give this a try. https://github.com/webpack-contrib/mini-css-extract-plugin/pull/378
Not works, because getReloadUrl() at line#148 goes before if (!isUrlRequest(url)).
Consider to judge href in raw? Or how about matching links those with rel=stylesheet only?
Oh, am I late?馃槀
rel can be omitted, what is problem?
@hsxfjames fix doesn't work for you?
@evilebottnawi
Not works, it still throws errors when I try to modify css. The error is from reloadStyle -> getReloadUrl -> normalizeUrl -> new URL().
I am in a limited network, so I'm also hard to paste full error message here. But you can easily try to reproduce this, just to add a simple link in base64 url form into any template you like. Let me know if you need other information~
@hsxfjames thanks
/cc @ScriptedAlchemy
@hsxfjames will work on this tonight, then ask you to test it again
looks like part of this fix broke some HMR for many @evilebottnawi
https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/issues/170
I removed the line, so help my users - i am very bad with regex. Any ideas on what we need to do
@ScriptedAlchemy https://github.com/webpack-contrib/mini-css-extract-plugin/pull/399#issuecomment-495333598