Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G gulp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gulp
  • gulp
  • Issues
  • #1487
Closed
Open
Issue created Jan 14, 2016 by Administrator@rootContributor

Gulp 4: gulp.parallel will stop gulp immediately when one task fails

Created by: per2plex

In the docs it is stated that gulp.parallel will still execute all tasks if an error occurs:

When the returned function is executed, the tasks or functions will be executed in parallel, all being executed at the same time. If an error occurs, all execution will complete.

This currently doesn't seem to be the case as the following minimal code example will demonstrate:

var gulp = require('gulp')

gulp._settle = false

gulp.task('error', function(done) {
  setTimeout(function() {
    done(new Error('Somethings wrong!'))
  }, 200)
})

gulp.task('willnotfinish', function(done) {
  setTimeout(function() {
    console.log('I will never finish :(')
    done()
  }, 2000)
})

gulp.task('watch', function() {
  gulp.watch('watchme.js', gulp.parallel('default'))
})

gulp.task('default', gulp.parallel(
  'error',
  'willnotfinish'
))

This will stop running gulp after ~200ms with the following output and the task 'willnotfinish' will never finish executing:

Using gulpfile ~/Desktop/development/gulp-parallel-error/gulpfile.js
Starting 'default'...
Starting 'error'...
Starting 'willnotfinish'...
'error' errored after 204 ms
Error: Somethings wrong!
  at null._onTimeout (/Users/perplex/Desktop/development/gulp-parallel-error/gulpfile.js:5:10)
  at Timer.listOnTimeout (timers.js:92:15)
'default' errored after 211 ms
The following tasks did not complete: willnotfinish
Did you forget to signal async completion?

EDIT: Include watch task in code sample

Assignee
Assign to
Time tracking