-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Importing an invalid URL breaks chunk loading #802
Comments
I don't see here the problem, your write invalid absolute URL (we ignore them) and we keep them in your code, so you have extra request with invalid url, don't forget sass keep absolute URLs as is in CSS, css-loader ignore absolute URL and keep them, otherwise loading fond from googlefonts and other services will not work, feel free to feedback |
@alexander-akait an invalid URL is causing none of our chunks to work. This didn't happen in webpack 4 so not quite sure what has changed. This issue maybe a related to a change further up stream. My concern is not that we get the error but that it causes the rest of the chunk to not execute. |
@rikbrowning it is runtime code, you can add rule for your linter to catch this
Why do you need broken URL? |
So the URL does work (its a URL for font license check) but what happens is when a user has an adblocker installed it will stop loading that URL (return 404) which previously was fine as the chunk still loaded. Now though nothing renders on the page due to that chunk failing. |
Please open an issue in font repo and ask them to remove broken URL, in future we will respect http/https URLs, we already have it for JS webpack/webpack#13925, so you build will be broken too, the main problem |
So the URL does work as I stated in my previous comment, the issue is when a user has an adblocker installed. The font repo is fine. |
Because you can rely on styles (change them) after loading CSS in your JS and it will be broken too |
How did this work in previous versions? Cause rolling webpack back fixes the issue. |
webpack design for static analyzable code, loading something broken is wrong, to solve it please remove wrong/broken at-rule import |
JS and CSS chunks should be loaded together, otherwise, as I said above, you create unsafe place(s) for your code |
I opened a discussion of this in internal slack channel for this, I will return with full answer late, anyway you should avoid these situations |
We're having a very similar issue. Our CSS chunks import fonts from Google Fonts. Unfortunately some of our enterprise clients block Google Fonts on their network, and so the fonts fail to import. Due to the decision here to block the entire chunk, our entire application therefore fails. Failure to import a font file should ideally not cause an entire chunk to fail - it's purely cosmetic. Is there any workaround for this? |
Expected Behavior
Having an invalid import in my SCSS should not break the loading of other Chunks. This worked when using webpack v4.
Actual Behavior
You get an error in the console and the chunks don't load.
Code
How Do We Reproduce?
Put together this repo showcasing the issue: https://github.com/rikbrowning/webpack5-link-issue
The text was updated successfully, but these errors were encountered: