jonkemp / jonkemp/gulp-useref

Unhandled stream error in transformStream

Open
#168 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
700
Forks
89
PR merge metrics
No merged PRs in 30d

Description

From reading code example, it is using lazypipe as transformStream, but lazypipe can only attach error listener after it is initialized. So I guess there is no way to capture transformStream's error in our gulpfile.

My situation is running a watch task for babel transformStream, once babel throw error a syntax error, it will exit the watch process, here is a short code example:

```
return gulp.src('./www/index.html')
.pipe(plugins.useref(
{},
lazypipe().pipe(function () {
return plugins.babel()
.on('error', onError);
});
));
```

In this case my onError won't end the transformStream as I wish.
My question is if we can add `on('error')` on those transformStream by default to `emit('end')` and let gulpfile handling the error itself. I would also appreciate any suggestion for how to handle this?

Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.