Closed cirosantilli closed 2 years ago
@cirosantilli sorry for the delay.
I have looked at your webpack.config.js
. You need to enable {sourceMap: true}
in sass-loader
as shown here.
I'm going to optimistically close this because this is very likely the problem. However please feel free to comment further and I will re-open as necessary.
OMG, thanks so much for looking into this! Adding sourceMap: true
solved it! Working updated code at: https://github.com/cirosantilli/cirosantilli.github.io/tree/c4a93c23e9e009a0a36e76673d167c6149295dec/web-cheat/webpack/sass
BTW, I the docs also mention adding: sourceMapContents: false
, but sass-loader 11.0.1 complained:
options has an unknown property 'sourceMapContents'
so I just removed it, and things worked. Must just be my sass-loader version.
:heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart: :heart:
But what if I do not need any css source-maps?
Trying to set sourceMap to false leads to this error
@mihanizm56 resolve-url-loader needs sourcemaps to function. You can choose to omit source maps from resolve-url-loader output, but whichever loader is chained before resolve-url-loader needs to output sourcemaps.
First sorry if this was answered at https://github.com/bholloway/resolve-url-loader/issues/107 but I couldn't easily find a solution there: OP said things magically started working somehow https://github.com/bholloway/resolve-url-loader/issues/107#issuecomment-431340329 and then the discussion seems to have morphed into a Windows CR/LF problem with the same error message, so hopefully a new issue is warranted.
Here is the exact reproducer: https://github.com/cirosantilli/cirosantilli.github.io/tree/d6b853618786a80884f9eeb1014070d8b797ddee/web-cheat/webpack/sass
I'm trying to use
katex.min.css
from https://github.com/cirosantilli/cirosantilli.github.io/blob/d6b853618786a80884f9eeb1014070d8b797ddee/web-cheat/webpack/sass/main.scss#L5 to produce a output .css file.Katex is a package with fonts included from the CSS:
node_modules/katex/dist/katex.min.css
starts with:and the font is located at:
If I don't use
resolve-url-loader
it fails to load with:And if I use it it fails with:
Interestingly, I did get things to work with both Less and a Js import: https://github.com/KaTeX/KaTeX/discussions/3115#discussioncomment-1021002 but the Sass looks like the best solution for my use case at the moment if I can make it work.