You may want to use 'multistream' or 'stream-combiner' instead of 'plumber'. Check this out:
https://github.com/gulpjs/gulp/blob/master/docs/recipes/combining-streams-to-handle-errors.md
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm getting weird errors when I run my default gulp task. I tried to log the errors with plumber but I do something wrong. I can't find a post of someone who had the same error before. Maybe it's too specific.
var gulp = require('gulp');
var sass = require('gulp-sass');
var run = require('gulp-run');
var notify = require('gulp-notify');
var autoprefixer = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
gulp.task('css', function() {
gulp.src('app/assets/sass/*.scss')
.pipe(plumber({
errorHandler: onError
}))
.pipe(sass())
.pipe(autoprefixer('last 10 version'))
.pipe(minifycss())
.pipe(gulp.dest('public/css'));
});
gulp.task('default', function() {
gulp.watch('app/assets/sass/*.scss', function() {
gulp.run('css');
});
});
Without plumber I get this error:
stream.js:94
throw er; // Unhandled stream error in pipe.
^
Error: source string:231: error: argument `$alpha` of `rgba($red, $green, $blue, $alpha)` must be between 0 and 1
Backtrace:
source string:231, in function `rgba`
source string:231
With plumber I get:
ReferenceError: onError is not defined / plumber is not defined // depending on how I have written it.
at Gulp.<anonymous> (/home/vagrant/code/larabook/Gulpfile.js:11:27)
at module.exports (/home/vagrant/code/larabook/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/home/vagrant/code/larabook/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/home/vagrant/code/larabook/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/home/vagrant/code/larabook/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
at /usr/lib/node_modules/gulp/bin/gulp.js:121:20
at process._tickCallback (node.js:419:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:906:3
No this was not the problem. Considering reading https://coderwall.com/p/2qrvsg
it was because "gulp.run() has been deprecated.". "The gulp.run() function will be removed in v4 of gulp, so the above code should be rewritten as."
The Laracast about Gulp is outdated. This is the new syntax:
gulp.task('watch', function () {
gulp.watch('app/assets/sass/*.scss', ['css']);
});
gulp.task('default', ['watch']);
Please or to participate in this conversation.