Why does gulp quit without finishing my task?
gulp, pug
Solution
The problem is, you have a bug in your `.jade` file which is causing `gulp-jade` to throw an error. Ideally, `gulp-jade` would throw a friendlier gulp error, giving you more info than just a blank screen but, since it's not, you need to handle this error yourself. You can either use `gulp-plumber` or handle errors coming directly out of that particular pipe manually like so:
var gutil = require('gulp-util');
gulp.task('jade', function() {
return gulp.src(paths.jade)
.pipe(jade())
.on('error', gutil.log)
.pipe(gulp.dest('./www/templated/'));
});
If you're interested, here are some more details on this error management problem in gulp.
Problem
I have the following gulp task: ``` var jade = require('gulp-jade'); var data = require('gulp-data'); gulp.task('jade', function(done) { return gulp.src(paths.jade) .pipe(data(function(){})) .pipe(jade()) .pipe(gulp.dest('./www/templated/')); }); ``` Which is trying to compile this jade file: ``` #{something.anything} ``` But when I try to run the task, the jade task quits without finishing: ``` $ gulp jade [14:39:24] Using gulpfile ~/path/gulpfile.js [14:39:24] Starting 'jade'... $ ``` And no output file is generated. I'm clearly missing something obvious here, but I can't tell what. Searches for 'gulp task not finishing' and the like only yield a lot of results discussing tasks which never finish. I am running the latest versions of gulp, gulp-jade and gulp-data (3.8.11, 1.0.0 and 1.2.0). If I remove the pipe to data, everything works. I have tried modifying the call to data, even requiring a valid json file as in the gulp-data example, but it still will not work. Why is gulp exiting without the task completing and without, seemingly, any error?