-
Notifications
You must be signed in to change notification settings - Fork 69
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
resolve-url-loader cannot operate: CSS error with commented line in css file #77
Comments
@Erwin16 this line is referencing a source-map on the file system. Certainly some source-map is necessary for `resolve-url-loader to do its thing. Usually the From the error though, it seems like (under the hood) |
@bholloway I'm coming here because I was waiting for the fix of #79. Now, since you've rolled out the fix on npm, I have the same issue that @Erwin16 encountered. This happened without a source code or webpack configuration change and did not occur in webpack < 4. Feel free to dig into it: julkue/form-components#9 (review) I'm looking forward to a fix that I can update to webpack 4. |
@bholloway I've noticed that I can't reproduce the error via Travis CI, only on my Windows 10 machine. |
@julmot I cannot easily see from your Webpack config what the problem might be. Are you getting exactly the same error? |
@bholloway Almost identical, yes. The yellow part is printed a few times, then the red part a few times afterwards. Can you reproduce it locally? $ git clone https://github.com/julmot/form-components.git && cd form-components && git checkout greenkeeper/webpack-4.0.0 && npm install && npm run build |
@julmot I encounter
However this runs fine on MacOS
I am just spinning up a windows 10 environment now. |
@bholloway You're right, I forgot to mention the pre-requirements: https://github.com/julmot/form-components/blob/master/CONTRIBUTING.md#requirements |
I see an error in So then I go into function resolveUrlLoader(content, sourceMap) {
if (/select-lite-arrow\.scss/.test(this.resourcePath)) {
console.error(sourceMap.sources);
}
... I get this at the top of the output...
Which looks like the bug is in some loader preceding But I suggest you use adjust-source-map-loader in your loader chain and set it to debug mode. ...
}, {
loader: 'resolve-url-loader'
}, {
loader: 'adjust-sourcemap-loader',
options: {
debug: /select-lite-arrow\.scss/
}
}, {
loader: 'postcss-loader',
... This gives diagnoses the same bad sourcemap with less hackery. So at this point we can say the fault is either adjust-sourcemap-loader:
C:\Users\IEUser\Documents\bholloway\form-components\src\components\select\select-lite-arrow\select-lite-arrow.scss
@ C:\Users\IEUser\Documents\bholloway\form-components\node_modules\postcss-loader\lib\index.js??ref--5-5
INPUT C:\Users\IEUser\Documents\bholloway\form-components\src\components\select\select-lite-arrow\C:\Users\IEUser\Documents\bholloway\form-components\src\components\select\select-lite-arrow\select-lite-arrow.scss
C:\Users\IEUser\Documents\bholloway\form-components\src\components\select\select-lite-arrow\C:\Users\IEUser\Documents\bholloway\form-components\src\components\_common\_form-components-icons.scss
C:\Users\IEUser\Documents\bholloway\form-components\src\components\select\select-lite-arrow\C:\Users\IEUser\Documents\bholloway\form-components\src\components\_common\_fonts.scss If you move adjust-sourcemap-loader:
C:\Users\IEUser\Documents\bholloway\form-components\src\components\select\select-lite-arrow\select-lite-arrow.scss
@ C:\Users\IEUser\Documents\bholloway\form-components\node_modules\sass-loader\lib\loader.js??ref--5-6
INPUT src\components\select\select-lite-arrow\select-lite-arrow.scss
src\components\_common\_base.scss
src\components\_common\_variables.scss
src\components\_common\_form-components-icons.scss
src\components\_common\_fonts.scss
src\components\_common\_mixins.scss
src\components\_common\_variables.scss
ABSOLUTE C:\Users\IEUser\Documents\bholloway\form-components\src\components\select\select-lite-arrow\select-lite-arrow.scss
C:\Users\IEUser\Documents\bholloway\form-components\src\components\_common\_base.scss
C:\Users\IEUser\Documents\bholloway\form-components\src\components\_common\_variables.scss
C:\Users\IEUser\Documents\bholloway\form-components\src\components\_common\_form-components-icons.scss
C:\Users\IEUser\Documents\bholloway\form-components\src\components\_common\_fonts.scss
C:\Users\IEUser\Documents\bholloway\form-components\src\components\_common\_mixins.scss
C:\Users\IEUser\Documents\bholloway\form-components\src\components\_common\_variables.scss Therefore I would say EDIT - Definitely a Windows problem. Here is the output of adjust-sourcemap-loader:
/Users/bholloway/Documents/bholloway/form-components/src/components/select/select-lite-arrow/select-lite-arrow.scss
@ /Users/bholloway/Documents/bholloway/form-components/node_modules/postcss-loader/lib/index.js??ref--5-5
INPUT /Users/bholloway/Documents/bholloway/form-components/src/components/select/select-lite-arrow/select-lite-arrow.scss
/Users/bholloway/Documents/bholloway/form-components/src/components/_common/_form-components-icons.scss
/Users/bholloway/Documents/bholloway/form-components/src/components/_common/_fonts.scss
ABSOLUTE /Users/bholloway/Documents/bholloway/form-components/src/components/select/select-lite-arrow/select-lite-arrow.scss
/Users/bholloway/Documents/bholloway/form-components/src/components/_common/_form-components-icons.scss
/Users/bholloway/Documents/bholloway/form-components/src/components/_common/_fonts.scss |
@julmot please confirm my analysis if possible. From looking at the attached issue in postcss-loader they seem pretty adamant that its a |
@bholloway I've tried the fix of webpack-contrib/postcss-loader#340 (comment) and I can confirm it's working. |
Looks like I note that |
I'm going to mark this as @Erwin16 sorry for the initial delay, I can reopen this if you need further help. I think your stackoverflow issue confirms my initial guess. I would suggest having 2 different rules for css so that raw css files do not encounter Please feel free to comment further here. |
I raised this issue on stack overflow (
https://stackoverflow.com/questions/48608703/vue-js-webpack-error-importing-css-file-from-external-library/48617366#48617366
)Building a vue.js app w webpack, and using resolve-url-loader for external css library loading ( aos css animation library ) , I got an error when building my app...
I discover that the the aos.css file has a comented last lien at the end
Withi this line in the aos.css code , I get an error compilation phase
If I suppress this line, then compilation is OK
I asked michalsnik why this commented line is still in the aos.css file , but I don't understand why the resolve-url-loader take it in account , it's a commented line after all..
thanks for clarifying this issue ...
The text was updated successfully, but these errors were encountered: