question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Continue gulp on error?

See original GitHub issue

I have the following gulp js code using the gulp-coffee plugin:


gulp.src('./**/*.coffee')
  .pipe(coffee({bare: true}))
    .on('error', gutil.log)
    .on('error', gutil.beep)
  .pipe(gulp.dest(destDir));

Whenever gulp-coffee throws an error (e.g. invalid coffee syntax), it stops the rest of valid coffee files from ‘piping’ through; even though the error is caught.

To clarify this, here is a sample file queued via gulp.src:

A.coffee (processed)
B.coffee (error and stops the rest of the stream)
C.coffee (not processed)

Is there a way to ‘continue’ the stream?

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:42 (39 by maintainers)

github_iconTop GitHub Comments

1reaction
Muganecommented, Sep 17, 2021

Isn’t --continue supposed to do this? It doesn’t, but isn’t it supposed to?

1reaction
dashedcommented, Dec 31, 2013

@Contra I put together a testbed at: https://github.com/Dashed/gulp-coffee-sandbox to demonstrate the issue.

Just npm install and gulp.

There are four coffeescript files:

subdir/a.coffee
subdir/b.coffee
subdir/c.coffee
d.coffee

The file b.coffee contains invalid coffeescript. Only c.coffee would not get compiled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Gulp image-min - How to continue after an error?
I have tried to capture the error and continue, but its not working once it hits a corrupted image the task then aborts....
Read more >
Async Completion - gulp.js
When a stream, promise, event emitter, child process, or observable is returned from a task, the success or error informs gulp whether to...
Read more >
Catching errors on Gulp.js - Boris - Medium
The recommended way to notify about occurred errors in gulp plugins is an emitting `error` event. But node.js streams, which are actually ...
Read more >
[L5.3] Webpack Doesn't Continue on gulp watch After Error
Hi,. While on the gulp watch, once webpack doesn't do its job subsequent modification once it encounters error on script. I have exit...
Read more >
Errors: Call the Plumber > Gulp! Refreshment ... - SymfonyCasts
Out of the box, Gulp supports error handlers where you say "Hey, instead of exploding all crazy, just call this function over here....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found