Closed olivierbossel closed 7 years ago
I have an issue probably related to this as well. I'm using gulp-sass though.
I have to specifically write @import '../../node_modules/my-module/index';
instead of node_modules/my-module/index
which used to work.
@olivierbossel can you provide a minimal project that reproduces this along with with the actual command line and log
@kaelig ...
isn't a valid path navigator. Try switching it to ..
@nschonni I updated my comment.
Here's a project you can test my issue in: https://github.com/salesforce-ux/design-system-starter-kit
Steps to reproduce:
git clone https://github.com/salesforce-ux/design-system-starter-kit.git
git checkout b3293e8b2f1f1bd9a1bb0c2174885cb4c4d99b81
npm install
npm run dev
This error pops up:
Error in plugin 'sass'
Message:
src/styles/index.scss
Error: File to import not found or unreadable: node_modules/@salesforce-ux/design-system/scss/index.
Parent style sheet: /Users/kdeloumeauprigent/workspace/salesforce/design-system-starter-kit/src/styles/index.scss
on line 9 of src/styles/index.scss
>> @import 'node_modules/@salesforce-ux/design-system/scss/index';
^
@kaelig you're not providing any value for includePath
in your Gulp config. node_modules
isn't automatically added to include paths anymore (or hasn't been for awhile AFIAK).
I thought the current directory was supposed to be in the includePaths by default (in that case: the root of the project from which the script is called)?
I thought the current directory was supposed to be in the includePaths by default
No, https://github.com/sass/node-sass#includepaths. That causes problems because then it starts to try and pick up random packages (accidentally) published components.
@nschonni node-sass src/styles/index.scss
works like a charm though. Is there something I'm missing here? Could it be related to gulp-sass directly?
Sorry the delayed response, Australian timezone and such. This is a bug. There was an unnecessary breaking change in LibSass regarding load paths. I missed this in the release notes for LibSass and forgot to compensate for it in node-sass.
I thought the current directory was supposed to be in the includePaths by default
This is kind of true.
@nschonni is correct in that node-sass isn't doing this.
LibSass was internally adding the cwd of the entry file to it's internal search path, which is similar to user defined load paths. This was removed in LibSass 3.5.0 release line. Node Sass needs to be updated to shim the old behaviour for the time being.
Could it be related to gulp-sass directly
@kaelig gulp-sass does add the cwd to the load path.
It's not clear to me why you're experiencing the issue with gulp-sass and not node-sass. I would expect the inverse to be true. I'll have to investigate tonight.
I am seeing this same issue as well. At first, I thought it as my gulp project where I am making lots of change so frequently.
A work around for now is adding the cwd to your includePaths.
You mean set SASS_PATH=. in your shell's environment.
?
No, I mean in the includePaths
array in the render/renderSync config object, or the gulp-sass config object.
gulp.src('./scss/*.scss')
.sass({ includePaths: ['./scss'])
.dest('./dest')
Hi there,
Sorry for the delay (Switzerland timezone...). Thanks for the quick response guys, seems that it's not an isolated issue. Did you need some help or that I post a demo project that has the issue?
Let me know! :)
npm -v
): 3.10.10node -v
): 6.9.4node -p process.versions
):Node Platform (
node -p process.platform
): darwinNode architecture (
node -p process.arch
): x64node-sass version (
node -p "require('node-sass').info"
):node-sass 4.4.0 (Wrapper) [JavaScript]
libsass 3.5.0.beta.2 (Sass Compiler) [C/C++]
npm node-sass versions (
npm ls node-sass
): 4.4.0Hi there,
Just to point out that the --include-path seems to not work anymore from this version. It was working in the node-sass 4.3.0 but not in the 4.4.0... When I import some node_modules sass like:
it is yielding that the file is not readable. It works if I force the 4.3.0 version...
Hope this is not something to big to fix... Let me know :)
Cheers guys, thanks for your work it's quite awesome!
Best regards
Olivier Bossel