ben-eb/gulp-svgmin

Failing

infn8 opened this issue · 1 comments

infn8 commented

just failing hard

./node_modules/orchestrator/index.js:153
            throw err;
            ^

TypeError: Cannot read property 'on' of undefined
    at DestroyableTransform.Stream.pipe (stream.js:45:7)
    at Gulp.<anonymous> (./Gulpfile.js:57:6)
    at module.exports (./node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (./node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (./node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (./node_modules/orchestrator/index.js:134:8)
    at Gulp.<anonymous> (./node_modules/gulp/index.js:36:18)
    at Gaze.<anonymous> (./node_modules/glob-watcher/index.js:18:14)
    at emitTwo (events.js:100:13)
    at Gaze.emit (events.js:185:7)

section of gulpfile

gulp.task('serve', function() {
    gulp.watch('svg/**/*.svg',['svgminify']);
});

gulp.task('svgminify', function() {
    gulp.src('svg/**/*.svg')
    .pipe(svgmin())
    .pipe(gulp.dest('./svgmin'));
});

gulp.task('default', ['serve']);

thoughts?

Your code works for me (adding in the extra dependencies);

var gulp = require('gulp'),
    svgmin = require('gulp-svgmin');

    gulp.task('serve', function() {
        gulp.watch('svg/**/*.svg',['svgminify']);
    });

    gulp.task('svgminify', function() {
        gulp.src('svg/**/*.svg')
        .pipe(svgmin())
        .pipe(gulp.dest('./svgmin'));
    });

    gulp.task('default', ['serve']);

I think you have an error somewhere else in your gulpfile, seems similar to this problem;

postcss/postcss#766 (comment)