floatdrop / gulp-plumber

Fixing Node pipes
MIT License
806 stars 32 forks source link

Error: Can't pipe to undefined #25

Closed russback closed 9 years ago

russback commented 9 years ago

Just been looking at capturing Sass compilation errors from gulp-ruby-sass and while the errors are captured and reported, I always get this undefined error. And when the files DO compile successfully, I still get the error and no final notify message:

var gulp = require('gulp'), 
    plumber = require('gulp-plumber'),
    rename = require('gulp-rename'), 
    notify = require('gulp-notify'), 
    sass = require('gulp-ruby-sass'), 
    cssmin = require('gulp-cssmin'),
    header = require('gulp-header'), 
    notifyOptions = {
        title: 'Test',
        sound: 'Frog',
        icon: './ui-theme/images/apple-touch-icon.png',
        onLast: true
    };

/**
 * Sass theme compilation
 */
gulp.task('css', function () {

    var notifyOptions = notifyOptions;

    gulp.src('./scss/styles.scss')
        .pipe(plumber(function (err) { 
            return notify().write(err);
        }))
        .pipe(sass({
            style: 'expanded', 
            lineNumbers: true
        }))
        .pipe(gulp.dest('./assets/css'))
        .pipe(cssmin())
        .pipe(rename({
            suffix: '.min'}
        ))
        .pipe(gulp.dest('./assets/css'))
        .pipe(notifyOptions);

});

The Sass files compile fine, so I'm not sure why this error is being thrown.

elassol commented 8 years ago

Did you found out why? I'm having the same issue

mkg0 commented 8 years ago

i had same too. it was for there was some undefined pipe at pipeline. at this example 'notifyOptions' throw undefined.