-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
includePaths do not work with Webpack 2 #366
Comments
@asolopovas Same issue here after upgrading to 5.0.0. Your suggested solution did not fix mine elas... Rolled back to 4.1.1 and issue disappeared. |
@pamtbaau solution works on 4.1.1, I am not suggesting that it does on 5. But version 4.1.1 does not work with options.includePaths either. |
@asolopovas includePaths work fine for me in 4.1.1: |
@pamtbaau if you read through documentation you will see that it should be working without LoaderOptionsPlugin, that's the point I am trying to make. |
+1 I'm running into this as well -- on 5.0.0 even the suggested |
The We have a test for |
I will tomorrow |
@jhnns here you go I have created two webpack configs one that works second one that fails |
Thank you. I use |
@asolopovas with sass-loader 4.1.1 and webpack 2.2.1, both config examples work. With sass-loader 5.0.1, |
Also check out our tests. |
@jhnns I have tried webpack 2.2.1 with both sass-loader@5.0.0 and sass-loader@5.0.1 both throw an error if I place includePaths into options of sass loader like that:
Which has not worked in the repository provided in webpack.config.error.js, I tested it on windows 10 x64 machine so clearly something fails. |
@jhnns yea I'm not dependent on this issue anymore as our infrastructure changed, but, when I was, I tested v5.0.0 with both the |
Ok, now I can reproduce this error on Windows (doesn't happen on macOS):
It seems like node-sass is exporting source maps with forward slashes (which are also valid on Windows). Webpack's source map module, however, stores backslash paths. That's why the source maps can not be resolved. I can fix this in sass-loader by applying Next time, please always post the actual error message including the stack trace. |
@jhnns next time I will. Thanks for reopening |
- Make all source map paths relative to the entry file. This way we don't have to read the `context` option from the webpack config. - Fix source maps on Windows: node-sass returns POSIX paths, that's why we need to transform them back to native paths. This fixes an error on windows where the source-map module cannot resolve the source maps. See #366 (comment)
@jhnns Hey,
reverting back to If I can provide more information please let me know. |
@janusch Could you try the latest sass-loader on master branch? If it's still not working, you can try to comment out these lines. Does it work then? How do the paths look like when they come from node-sass? |
@jhnns hey just tested |
Still does not work on my machine.
Here is my webpack config just in case
And my dependencies
|
@asolopovas Running your example repo and
|
@jhnns I have updated my sass-loader-test and it confirms that something is not right, the problem seems to be with vue-loader or sass-loader as they don't seem to work together. If I import 'foundation' via app.js file things work fine, if I do import foundation from withing vue component things begin to break down. But most recent vue-loader still works fine with sass-loader@4.1.1 and LoaderOptionsPlugin with the same setup where I |
I don't know what the vue-loader is doing, but if I remove the sass-loader and just try to compile |
The sass-loader has its own loader pipeline. This configuration fixed the issue:
|
A hack solution is definitely better then no solution thanks. Do you think it is the problem with vue-loader? |
Oh, I don't think that this is a hack solution. Since a |
Well vue references the file format in style section and utilises sass-loader, so I do not see the reason why it can't read setting from inside sass-loader options, it's successfully does that from babel and typescript loaders. So it's either some adjustments could be done to sass-loader or to vue-loader and as I have noticed mac users do not complain about this issue. I might be wrong anyhow. It just feels wierd to concentrate includePaths inside vue loader pipeline.
…On 28 Feb 2017, 12:55, at 12:55, Johannes Ewald ***@***.***> wrote:
> A hack solution is definitely better then no solution thanks
Oh, I don't think that this is a hack solution. Since a `vue` file can
host a lot of file types, it makes sense to have a dedicated loader
pipeline because webpack's loader `test` algorithm wouldn't work here.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#366 (comment)
|
If you have a |
This is my config and it's working with your sass-loader-test repository
|
@jhnns Thank you a lot for this library, and your support. I understand your point, I think that vue-loader with their custom pipeline could added a feature that if no additional setting provided into the pipeline, vue-loader could use default options from sass loader config, that would be definitely convenient. |
@jhnns disregard my previous comment, I did a mistake on my end so I deleted that comment everything works as you said. |
No problem. You're welcome :) I'm willing to help if the other side is providing a test repository. This makes spotting bugs/wrong configurations a lot easier. |
hey guys , i found a new way for importing slick and slick.scss it is so simple:
(8) comment them out , |
Hi everyone,
I am using Windows 10 x64 and Webpack 2, with sass-loader version 4.1.1 , but can't use standard syntax
The only way to get this to work is to use LoaderOptionsPlugin
Otherwise it throws an error saying can't import 'foundation' and so on. LoaderOptionsPlugin stops to work as of version 5.0.
The text was updated successfully, but these errors were encountered: