Gulp: Gulp tasks finish but the process never exits.

Created on 14 Feb 2015  路  10Comments  路  Source: gulpjs/gulp

As of about two days ago, my gulp tasks are finishing but the process is not exiting. I've tried narrowing down what changed between before and now, but nothing I try can get me back to the original working behavior.

I first noticed this after upgrading to 3.8.11, but I've since downgraded and the problem persists. I tried on a different computer that had the same repo checked out and it worked fine. Then after running npm install and upgrading all packages, I get the same issue. Again, I've tried downgrading and attempting to get back to the working behavior, but I can't seem to no matter what I try.

As a reduced test case, I created the following task:

gulp.task('noop', function() {});

I then ran gulp noop with the following output:

[16:57:46] Using gulpfile ~/Projects/solved-by-flexbox/gulpfile.js
[16:57:46] Starting 'noop'...
[16:57:46] Finished 'noop' after 41 渭s

But the process never exits. Has anyone else experienced this?

I'm not sure if it matters, but I'm running iojs v1.2.0 and gulp v3.8.11. I've tried using node v0.10.29 and gulp v3.8.10 (which was working the other day), but it still doesn't work.

Most helpful comment

Just to let you know, I ran into a similar issue with nunjucks. If you are using nujucks.configure, make sure you add watch: false as an option.

nunjucks.configure('template', {watch: false});

All 10 comments

Post the whole gulpfile, not just the task please.

https://github.com/philipwalton/solved-by-flexbox/blob/master/gulpfile.js

Which doesn't include the noop task, but none of the existing tasks are completing either.

I haven't seen that myself but someone on StackOverflow had the same problem couple of months ago. I got the impression that something non-gulp related was going on because I couldn't reproduce it at all.

SO questions I was talking about:

@philipwalton Does your reduced test case gulpfile include only this:

var gulp = require('gulp');
gulp.task('noop', function() {});

Okay, I found the culprit. Upgrading nunjucks from 1.1.0 to 1.2.0 was causing the problem. I'll file a bug with them.

Yep. The culprit is always a library that is keeping an extra handle open. I've run into this with database drivers and libraries that implement their own watching mechanisms. Glad you tracked it down.

Just to let you know, I ran into a similar issue with nunjucks. If you are using nujucks.configure, make sure you add watch: false as an option.

nunjucks.configure('template', {watch: false});

:point_up: Just did the same thing with nunjucks. Thanks @troch for the reminder!

Came back here for https://github.com/gulpjs/gulp/issues/903#issuecomment-91589780

Thanks.

Please use emoji reactions :tada: instead of leaving a comment and sending notifications (and emails 鉁夛笍馃槹), thank you! 鉁岋笍

Was this page helpful?
0 / 5 - 0 ratings