OverZealous / run-sequence

Run a series of dependent gulp tasks in order
MIT License
961 stars 56 forks source link

runSequence breaks if I have no gulp.dest in my task and try to return the stream. #79

Closed marcofugaro closed 7 years ago

marcofugaro commented 8 years ago

I've noticed that if I have no gulp.dest in my task and I try to return the stream, runSequence breaks and I have to CTRL+C out of it.

The task is a linting task, so I don't need to output anything, here is the task and the line of code that if you remove, it breaks.

Here is the runSequence where I'm calling the task from.

What should I return if my task has no gulp.dest?

OverZealous commented 8 years ago

I'm not sure how to help you here. All run-sequence does is listen for the gulp task to end. Once it ends, it starts the next one.

It's almost as simple as manually running gulp foo && gulp bar && gulp baz, though it's a bit smarter than that.

Can I assume that task ends correctly when run on it's own?

One other thing that stands out to me is that you are calling .on on the result of the pipe function, rather than on the result of gulpStylelint. That might be the underlying issue.

marcofugaro commented 8 years ago

Yup, the task runs fine when called from gulp.watch or called alone. It happens only when called with runSequence, and for this I think the issue is that maybe I am not ending a gulp stream correctly.

Also this issue happens only when stylelint emits an error.

Also yes, I've tried calling .on('error' directly on stylelint, but there is no difference, I put it there because I saw it in some recipe somewhere, being called on the stream and usually that catches the error.

Here is an image of what happens:

Also this happens also with eslint when there is no gulp.dest or gulpif after the error

OverZealous commented 8 years ago

Yeah, I'm sorry I don't really have a solution. It's never been an issue for me. It's possible it's a fault within gulp-stylelint, but I really couldn't tell you for sure.

marcofugaro commented 8 years ago

Yeah I don't understand it either, it happens also with gulp-eslint

olafgleba commented 8 years ago

Hi, same issue here. Solved it apparently by setting the stylelint option failAfterError: false (https://github.com/olegskl/gulp-stylelint#failaftererror) explicitly.

marcofugaro commented 8 years ago

@olafgleba I need it to fail to invoke this gulp-notify error handler:

.on('error', notify.onError('<%= error.message %>'))

I do the same thing with eslint and it doesn't break the stream

OverZealous commented 7 years ago

@marcofugaro Did you ever solve this? Given the above comment, I'm assuming it's because the stream never ends, which means that run-sequence can't continue. If that's the case, the issue is not with run-sequence, because if a task never ends, then there's no way to know to move on to the next one.

I'm going to close this out, but you can reopen it if you find new information that points specifically to a bug or improvement for run-sequence.