gulp-sass: Partials not found error

Hi there,

I’ve only found one submission for this problem but the fix doesn’t work for me. Every so often at random intervals I get the error: file to import not found or unreadable: partials/header

I’ve tried setting the include paths but to no avail. My task looks like:

gulp.task('sass', function() {
    gulp.src('assets/scss/**/*.scss')
        .pipe(sass({style: 'expanded', includePaths: [ './assets/scss/partials', './assets/scss/modules', './assets/scss/helpers' ], errLogToConsole: true }))
        .pipe(autoprefixer('last 2 version'))
    .pipe(rename(pkg.name + '.css'))
        .pipe(gulp.dest('assets/css'));
        // .pipe(reload({stream: true}))
        //.pipe(notify({message: 'SCSS processed!'}));
});

I also tried commenting parts out in order to find a problem line but nothing seems to help. Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 79

Most upvoted comments

@smiddus +1 – In Sublime Text 3, after setting the atomic_save property to true in my user settings I no longer receive this error.

Hey guys, I don’t know if it helps, but I just found out that enabling atomic save in Sublime Text 3 fixes the problem for me ( I had set it to false, default is true).

Hi all, i dont know if the problem was resolved but i use this solution and works to me… In the pipe sass i added a includePath to the route of my scss file Example: .pipe(sass({ includePaths: [config.bootstrapDir + ‘/assets/stylesheets/bootstrap’] })) i hope this works to you too

@negativefix Using Sublime 3 with atomic_save: true is just a band-aid. gulp-sass is definitely doing something differently than most other gulp modules, and that’s causing this issue. That’s not to say that it’s doing something wrong - it’s just doing something differently, in a way that doesn’t work with many text editors’ save strategy. I don’t know what it is, but if I can find the time, I’ll try to dig in.

so we need to switch to sublime in order to get around this problem? <- emacs user.