question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gulp-sass doesn't seem to play nice with sass imports

See original GitHub issue

Right now if any of my sass files have an @import in them I get an error like this:

stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
source string:1: error: file to import not found or unreadable: 'normalize'

Where normalize is a normalize.scss in the same directory.

This seems to be because you are using the data option without an includePaths.

This could maybe be solved with an includePaths option?

gulp.src('./styles/main.scss')
  .pipe(sass({includePaths: ['./styles']}))
  .pipe(gulp.dest('./styles'))

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:25
  • Comments:89 (8 by maintainers)

github_iconTop GitHub Comments

49reactions
smnarnoldcommented, Jul 22, 2015

My problem was caused by a combination of Sublime Text and a slow hard drive. We were able to solved it by changing the setting atomic_save to true. Preferences > Settings - User > "atomic_save": true

9reactions
xiaofuyesnewcommented, Feb 8, 2017

@Shaker-Hamdi Great idea! Basicly the right cause.

So we can slow down the complie speed and code gulpfile like this:

gulp.task('sass:dev', () => {
    return setTimeout(() => {
        return gulp.src('./sassPath/*.scss')
        .pipe(sass())
        .pipe(gulp.dest('./distPath/css'))
        .pipe(reload({ stream: true }))   //if you use browser-sync
    }, 500)
})

It works fine for me! Hope it could be helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gulp-sass seems not resolving imports - Stack Overflow
So it seems to me that the sass task are not handling the import (even with the includePaths options). While if I do...
Read more >
Sass: @use
Sass makes it easy to define a private member by starting its name with either - or _ . These members will work...
Read more >
Stop using @import with Sass | @use and @forward explained
A quick note, if you are using node- sass, it is out of date and @use and @forward, as well as their entire...
Read more >
sass-loader - webpack - JS.ORG
This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use. Note. We highly recommend...
Read more >
Fixing gulp-sass issues in gulp 4. - DEV Community ‍ ‍
Update your gulp task as necessary. Set your sass compiler to sass (Dart-sass). "sass.compiler = require('sass');". Here is my ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found