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
Module build failed: Error: resolve-url-loader: CSS error #107
Comments
At first glance I see nothing wrong in your config.
From memory that error implies the source map fails a lookup at that
particular statement. But I am not sure that helps us.
Data uris are not processed which implies the problem may not be that line.
Try removing that line or at least that URL and make absolutely sure that’s
the problem.
Also try the debug option and see if that helps confirm your understanding
of what urls are being considered.
My apologies if you have already done this. Just my first thoughts.
|
Thanks, I did these things, and nothing userful in debug mode. I tried to turn off the sourceMap too, it isn't help. |
And one more thing: I use several background-images in several other files in this project, and those works fine. Those files hasn't any difference (except the file names of course). I suspect a bug in resolve-url-loader, because this malfunction came out earlier but it was gone. I belived my colleges solved the problem, but now I asked them, and nobody solved it. Simply just gone. Strange. |
I'm getting the same error after upgrading, but only on windows. on MacOS it builds just fine. In my project i use Using |
(Also, downgrading to |
@netdjw I interpreted this as the problem went away. Is this still a problem with you? Is this a problem with your colleagues? |
Just reacquainting myself with the code. It looks like any This happens before we look further at the @asbjornh @netdjw I need some more data. Some ideas...
My current theory is that there is some upstream problem with the source-map sources. You should look to see it includes all the files you are compiling. |
Yeah, I'll see if I get the time to create a minimum example during this week :) |
Still working on narrowing this down, but it’s starting to look like an upstream error that’s not properly handled like you suggested. Right now I have a huge mixin (without any url calls), and when I remove it, the build runs fine. When it’s included, the build crashes with an error message from resolve-url-loader. |
Ok this is quite weird. I've narrowed it down as far as I can I think. This setup fails with the above mentioned error on Windows 10, Node As you can see in I also tried downgrading to webpack.config.js
package.json
style.scss
Shell output:
Generated css file with
|
This is some really good work @asbjornh! The 🤔I guess the sources look normal. I suspect something to do with the different line break characters in Windows, I am wondering if @netdjw can point to similar code. Is the same problem you both have or 2 different problems. For my part I will create a test case for this as soon as I get some time. In the mean time please let me know if the engine-only downgrade helps you for now. |
Yep! |
@asbjornh as an outside chance take a look at the linefeed option in node-sass. You should be able to set this in EDIT - although surely this must be something in |
Looking at But how this would make the source-map unusable I am unsure. 🤔 |
I'm also encountering this issue on Windows: The
Removing the line break from the
The contents of src/baseStyle/index.js are straight forward:
|
@ZebraFlesh If you can setup a minimum breaking example repo then I can devote some time to debugging. Earlier I tried to create a test case but I could not reproduce the problem on windows. |
I had this issue as well, the following change fixed it:
Sorry, I don't have time at the moment for a minimal repo! |
Passing |
Changing
When
Note the 2 Unfortunately, The |
@michaelbeaumont I would not expect to see naked |
There are no naked I might be overlooking something obvious, but it seems very much like a Anyway, I stopped investigating further because this led me to the fix (for this specific case at least) of just removing the line breaks after the commas. |
Sorry @michaelbeaumont I see now that you did originally say that.
|
To summarise There is some issue with multiline declarations.
The workarounds
Remaining
|
I've synthesised an orphan CR in tests and it (correctly) fails in both MacOS and Windows. That has allowed me to draft a possible fix in #108. I won't publish this pre-release because really I am not sure we are on the right track. It remains to be see that this fixes the actual problem. So please install |
I've been forced to rollback to version 2.0.2, maybe it's a dependency
problem with laravel-mix 4.0.15 ?
Le jeu. 21 mars 2019 à 22:07, Ben Holloway <notifications@github.com> a
écrit :
… Sorry been completely slammed with work. Have not yet investigated further
the root cause.
Please let me know if this is immediately needed. Otherwise I’ll stick to
the plan above.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#107 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHnRsBkize4CT99ZMVU6J9PITKopfMnTks5vY_R3gaJpZM4XwFg8>
.
|
I moved the breaking example to resolve-url-loader-107. The As promised by @asbjornh this does pass in MacOS and fail in Windows (for me). Analysis On checkout in windows it appears with
Running stand alone sass compile.
Interestingly the line feeds come out as LF (
With appropriate settings for linefeed.
The line feeds come out as CRLF (
Conclusion Certainly looks to be a bug in SASS. Sure the example breaks in webpack but the root cause is reproducible in But this is simply reproducing the excellent work of others above. |
So the The Sorry for the delay. Its been a pleasure working with you all on this. |
Anyone? Pls help X) |
Dude, just read the comments... Already answered |
@asbjornh DUDE, the comments does NOT answer my question about using |
Okay lets discuss on #125 and keep this particular issue closed. |
I had the same probleme with resolve-url-loader: CSS error and I found the fix adding removeCR and sourceMap:
|
Error: resolve-url-loader: CSS error source-map information is not available at url() declaration (found orphan CR, try removeCR option) see: bholloway/resolve-url-loader#107
…3, Diego) This PR was merged into the master branch. Discussion ---------- Allow to configure the resolve-url-loader This PR solve the error below, occuring on some cases: ``` Error: resolve-url-loader: CSS error source-map information is not available at url() declaration (found orphan CR, try removeCR option) ``` See discussion: bholloway/resolve-url-loader#107 Commits ------- b7c7e66 Add documentation for resolveUrlLoaderOptions 4671016 Fix lint job 392d32b Merge branch 'master' of https://github.com/diegocardoso93/webpack-encore a52bb05 Add optional resolve-url-loader options 01e1da7 Add optional resolve-url-loader options 906ae9b Fix "found orphan CR, try removeCR option" 988e5d1 Update resolve-url-loader to v3.1.0
With Webpack Encore : (Version ^0.28.0 required)
|
This is not to open this issue, but just to document my findings. I also hit this issue after doing a yarn upgrade. To resolve, I used the excellent instructions given here: https://npm.runkit.com/resolve-url-loader
My output CSS of 11K LOC threw up a few instances of standalone 0D (without ODOA). This turned out to be the issue:
|
where did you add these lines exactly?? |
same question... just wondering where you add that |
Not a permanent solution but this post on stackoverflow helped me to serve and build my project.
|
Well... |
|
Furthermore in So there should not be a use case for |
I had the same issue I just uninstalled node-sass and installed sass instead and it now works fine |
Hi,
I have a strange malfunction with resolve-url-loader. I have this webpack.config.js:
this is the package.json file:
In the SCSS file I have this line what is the reason of the problem:
background-image: url('img/hero-slider-arrow.png');
I tried to change this line to this one:
background-image: url('data:image/png;base64,iVBORw0KGgoAAAA...==');
And in both case I got this error message:
Doublechecked the image file is on that path what is given. But if I use data:image/png solution... same error message. I don't understand what is the problem.
The other images working fine with similar url('img/filename.png') format.
Any idea?
The text was updated successfully, but these errors were encountered: