Watch task not continuing after error caught by Gulp-plumber has been fixed despite errorHandler callback -


so got neat gulpfile , all, , it's working smoothly except 1 thing.

i'm running gulp-plumber stop watch task crashing on error, error getting caught when fix error, watcher refuse continue. added handleerror callback doesn't appear though this article says should. driving me insanity because know people has gotten working without of these none of solutions i've found seems work. have missed something?

edit: when have error in _lists.scss example error thrown looks this:

[22:04:43] plumber found unhandled error: error in plugin 'gulp-sass' message: styles\partials\_lists.scss 1:1  invalid top-level expression 

does mean have handle error manually using on.('error', function() {})? because thought plumber purpose, remove manual error handling. tried manually catching error using spit out error in console , refused continue before.

here's plumber pipe part:

// compile our scss minified css gulp.task('styles', function() {   return gulp.src('styles/main.scss')     .pipe(plumber({       handleerror: function (err) {         console.log(err);         this.emit('end');       }     }))     .pipe(sass({ style: 'expanded' }))     .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))     .pipe(gulp.dest('dist/styles'))     .pipe(rename({ suffix: '.min' }))     .pipe(minifycss())     .pipe(gulp.dest('dist/styles'))     .pipe(notify({ message: 'finished compiling scss' })) }); 

and here's whole gulpfile.js:

var gulp         = require('gulp'),     sass         = require('gulp-sass'),     autoprefixer = require('gulp-autoprefixer'),     minifycss    = require('gulp-minify-css'),     plumber      = require('gulp-plumber'),     jshint       = require('gulp-jshint'),     uglify       = require('gulp-uglify'),     imagemin     = require('gulp-imagemin'),     rename       = require('gulp-rename'),     concat       = require('gulp-concat'),     notify       = require('gulp-notify'),     cache        = require('gulp-cache'),     livereload   = require('gulp-livereload'),     htmlmin      = require('gulp-htmlmin'),     del          = require('del');  // minify our html gulp.task('html', function() {   return gulp.src('*.html')     .pipe(htmlmin({ collapsewhitespace: true }))     .pipe(gulp.dest('dist')) });  // compile our scss minified css gulp.task('styles', function() {   return gulp.src('styles/main.scss')     .pipe(plumber({       handleerror: function (err) {         console.log(err);         this.emit('end');       }     }))     .pipe(sass({ style: 'expanded' }))     .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))     .pipe(gulp.dest('dist/styles'))     .pipe(rename({ suffix: '.min' }))     .pipe(minifycss())     .pipe(gulp.dest('dist/styles'))     .pipe(notify({ message: 'finished compiling scss' })) });  // concat , compile our js minified file gulp.task('scripts', function() {   return gulp.src('scripts/**/*.js')     .pipe(jshint())     .pipe(jshint.reporter('default'))     .pipe(concat('main.js'))     .pipe(gulp.dest('dist/scripts'))     .pipe(rename({ suffix: '.min' }))     .pipe(uglify())     .pipe(gulp.dest('dist/scripts'))     .pipe(notify({ message: 'finished compiling scripts' })); });  // compress our images gulp.task('images', function() {   return gulp.src('images/**/*.js')     .pipe(cache(imagemin({ optimizationlevel: 5, progressive: true, interlaced: true })))     .pipe(gulp.dest('dist/images'))     .pipe(notify({ message: 'finished compiling images' })); });  // clean/empty our dist folder gulp.task('clean', function(cb) {   del(['dist/styles', 'dist/scripts', 'dist/images'], cb) });  // run our tasks when using 'gulp' command in cli gulp.task('default', ['clean'], function() {   gulp.start('html', 'styles', 'scripts', 'images'); });  // watch our files changes gulp.task('watch', function() {   gulp.watch('styles/**/*.scss', ['styles']);   gulp.watch('scripts/**/*.js', ['scripts']);   gulp.watch('images/**/*', ['images']); }); 

it might typo.

try replacing handleerror errorhandler.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -