Closed wujekbogdan closed 6 years ago
Unfortunately this is what you get with webpack.
The file does not matter until it gets to the CSS loader. The CSS loader treats the file like any other import.
Just setup a simple rule for a single Sass file and use only the sass loader and CSS loader. You should see exactly the same behaviour without using this loader.
OK, thank you for the clarification. I wasn't sure is it the resolve-url-loader
issue or something else. So, what is the proper place to report this issue? webpack core repo?
@wujekbogdan I had a thought...
It may be that css-loader
would give you better line numbers but that the source-map is not getting through.
Please try
?sourceMap
for all the loaders up until css-loader
.devtool
(I forget the exact setting).I would hope one or both of these gives you a better location. However I don't think anything will give you such a nicely formatted error as you originally hoped.
To answer your question: url()
statements are processed by the css-loader
.
When I make a syntax error in the scss code, I can see an error that looks like this:
So, I can see what happened and where it happened. It's a line 2, column 3, media.scss file.
But when I mistype the resource url, for example:
then this is what I see in the console:
So, I can only see that this is something related to scss and a the
./this/path/is/wrong.png
file. But there's no scss file name in the console output and no line number.It happens only when I provide a path to an unexisting resource in the url(), so I assume that this is a bug in the
resolve-url-loader
. Correct me if I'm wrong.This is my webpack config:
And this is my
package.json
It's not an environment related issue. It happens on Windows and on Mac. Is there anything else I can provide you with?