treehouse-gulp-basics icon indicating copy to clipboard operation
treehouse-gulp-basics copied to clipboard

SASS error interrupts watchFiles function

Open ayezee33 opened this issue 10 years ago • 1 comments

Not sure what I am missing, I am using the same gulpfile/folder structure and whenever there is a sass error it stops watchFiles function.

ayezee33 avatar Nov 06 '15 16:11 ayezee33

I experienced the same issue and solved it by using "on('error')" like the below example:

gulp.task("compileSass", function () {
    gulp.src('app/styles/**/*.scss')
        .pipe(maps.init())
        .pipe(sass({
            outputStyle: 'expanded'
        })
            .on('error', sass.logError))
        .pipe(maps.write("./"))
        .pipe(gulp.dest('app/styles'));
});

i am very new at this so i dont know exactly why it keeps running - but it does :). I am guessing it is because it runs sass.logError upon something going wrong but it does not write anything to the console.

take a look at this stackoverflow question for more info:

http://stackoverflow.com/questions/21080433/gulp-sass-watch-stops-when-invalid-property-name

rsjorslev avatar Feb 03 '16 18:02 rsjorslev