floatdrop / gulp-plumber

Fixing Node pipes
MIT License
807 stars 32 forks source link

Issue with gulp-stylus #12

Closed andrewmartin closed 10 years ago

andrewmartin commented 10 years ago

Hi there, so I have pipe(plumber()) working great with .coffee files, but for some reason with my stylus task, it seems it isn't working. When I hit a compilation error, I have to spin up gulp again and all other tasks stop.

Here is my task:

var gulp = require("gulp"),
  notify = require("gulp-notify"),
  plumber = require('gulp-plumber'),
  stylus = require('gulp-stylus');

  gulp.task("stylus", function() {
    return gulp.src("public/stylesheets/application.styl")
      .pipe(plumber())
      .pipe(stylus({
        set: [
          "resolve url",
          "include css",
          "linenos",
          "compress"
        ]
      })).on("error", notify.onError({
        message: "<%= error.message %>",
        title: "Stylus Error"
      }))
      .pipe(gulp.dest("public/stylesheets"));
  });

Is this a known issue with plumber? I tried without the .on("error") method and it still fails.

floatdrop commented 10 years ago

I think this pull-request will fix your problem.

pgilad commented 10 years ago

Yeah it's a particular problem with gulp-stylus that incorrectly handles errors. I submitted a PR to fix it, although it might be delayed a bit to be in line with gulp errors guideline.

floatdrop commented 10 years ago

This is fixed in gulp-stylus.