-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
Unexpected output of url includes file://
protocol
#1362
Comments
fille://
protocol file://
protocol
problem solved by simply set options.esModule to |
What is target? Which loader do you use too? options.esModule to false is dirty workaround |
I've got the same issue (target web). For me there are strange changes on snapshots like here : 7ec5831#diff-667e298268e5db9f9f30c5a0b51b917e019a229d5ec4291f8435af819f4a64d7R276 (@cap-Bernardito / @alexander-akait) In my case :
and i always get Edit : I need to update my https://github.com/webpack-contrib/mini-css-extract-plugin plugin. I'm trying this tomorrow and i'm telling you if it was the problem |
Yes, we describe it, with |
Yes it was that, i'm using a fork (webpack-contrib/mini-css-extract-plugin#711) so i didn't seen it first. |
Why do you use fork? |
I've got a specific component in charge of loading async component (aka loading associated js/css/rtl-css in parallel) based on data collected by assets-webpack-plugin.
|
Can you provide small example (need to check)? I think I know how you can solve this in a more correct direction. |
I used the web target |
@Fi2zz update |
it generate file:// protocol before the plugin |
Anyway, thank for help |
@Fi2zz run |
on my webpack :
then AssetPlugin provides me almost what i'm set in my window.ASYNC_COMPONENTS_MAP which is something like
and when i need a chunk dynamically i'm doing
where resolve and chunkName are coming from the chunk declaration :
|
So you load async CSS chunks manually? |
Yes. JS + CSS (or RTL version of CSS depending the case) |
I think here problem with |
Ideally |
when i generate my HTML i'm changing my window.ASYNC_COMPONENTS_MAP from
to
on a RTL country |
Yep, I see, you need modify generated runtime... Ideally it can be solved using plugin and it will be right solution |
My technical stack is up to date but highly customized so i'm not asking you (or someone) to change something on mini-css-extract-plugin or anywhere else. I think i am the only one to use mini-css-extract-plugin to just "extract css" 😉 and i'm rather have to adapt a well maintained plugin like mini-css-extract-plugin on each update than developing a new one. |
@cbazureau in theory we can add flag |
yes if you agree to, i can push you a PR next week on mini-css-extract-plugin project |
Yes, feel free to send, we just need to doc it, because it is very exotic |
FYI for others encountering this bug: I found that this bug exist if we use css-loader (v6) + mini-css-extract-plugin (v2) with webpack <= 5.22.0. Found that bug will not exist anymore if webpack is upgraded to >= 5.23.0 Repro: https://github.com/kenrick95/css-loader-repro-file-protocol |
@kenrick95 thanks, this solved the problem for me. I was using css-loader v6.7.1, mini-css-extract-plugin v2.6.0, and webpack v5.21.0. I was getting my
(where Upgrading webpack (now i'm on 5.71.0) fixed it! |
Using default options of
css-loader
transform
background-image: url(../img/foo/bar.jpg)
supposed to bebackground-image: url(/img/foo/bar.jpg)
but go
background-image: url(file:///img/foo/bar.jpg)
,please see the code below
the original css code
Expected Behavior
Actual Behavior
Code
The text was updated successfully, but these errors were encountered: