Gulp 4 parallel task error propagation limits
0 reputation · 11 Dec 2025, 19:07 UTC
Gulp 4 replaced implicit dependency ordering with explicit orchestration through gulp.series and gulp.parallel. Each task must signal completion by returning a stream or promise, invoking a callback, or using an async function. When a stream emits an unhandled 'error' event, the Node.js process can crash unless the error is intercepted.
In a parallel composition, this raises a specific uncertainty: if one branch fails with an uncaught stream error while sibling branches are still running, does the Gulp 4 runtime guarantee that those sibling tasks are stopped, or may they continue in flight until the process exits? The documentation emphasizes explicit completion signaling, but the exact boundary between task-level error handling and orchestrator-level process termination is not always clear.
This distinction matters for build pipelines where a failed compile or lint step should not leave orphaned watchers or partially written assets from other concurrent tasks.
Does Gulp 4's gulp.parallel documentation specify whether an uncaught stream error in one branch terminates sibling tasks already in flight? Is there a documented, built-in way to intercept such errors at the composition level without wrapping every stream in an external plugin?