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.

Gulp silently shuts down on task returning empty stream

See original GitHub issue

What were you expecting to happen?

Running gulp all I expect to see:

[15:27:25] Using gulpfile /var/www/project/gulpfile.js
[15:27:25] Starting 'streams'...
[15:27:25] Finished 'streams' after 1.66 ms
[15:27:25] Starting 'dep'...
dep
[15:27:25] Finished 'dep' after 140 μs
[15:27:25] Starting 'all'...
all
[15:27:25] Finished 'all' after 84 μs

What actually happened?

After starting streams task gulp silently exits with code 0:

$ gulp all
[15:28:30] Using gulpfile /var/www/project/gulpfile.js
[15:28:30] Starting 'streams'...
[15:28:30] Starting 'dep'...
dep
[15:28:30] Finished 'dep' after 177 μs
$ echo $?
0

Please post a sample of your gulpfile (preferably reduced to just the bit that’s not working)

gulp.task('dep', function () {
    console.log('dep')
})
gulp.task('streams', function () {
    const streams = require('merge2')()

    return streams
})
gulp.task('all', ['streams', 'dep'], function () {
    console.log('all')
})

What version of gulp are you using? What versions of npm and node are you using?

$ gulp --version
[15:23:48] CLI version 3.9.1
[15:23:48] Local version 3.9.1
$ npm -v
5.2.0
$ node -v
v7.8.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
phatedcommented, Aug 19, 2017

@terinjokes brought up a good point. We already handle this if you are using the separate gulp-cli module. Check out https://medium.com/gulpjs/gulp-sips-command-line-interface-e53411d4467 for more details. (Caveat: you might need gulp 4 to have accurate warning messages).

0reactions
phatedcommented, Aug 21, 2017

@pattyjung you subscribed to the thread and must unsubscribe yourself, none of us can do that for you…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does a gulp task have to return anything? - Stack Overflow
If you do not return a stream, then the asynchronous result of each task will not be awaited by its caller, nor any...
Read more >
Browsersync options
Browsersync makes your browser testing workflow faster by synchronising URLs, interactions and code changes across multiple devices.
Read more >
The Complete Stories - Vanderbilt University
The Complete Stories brings together all of Kafka's stories, from the classic tales such as "The Metamorphosis," "In the Penal Colony" and "The...
Read more >
Child process | Node.js v19.3.0 Documentation
Each of the methods returns a ChildProcess instance. ... Closes the IPC channel between parent and child, allowing the child to exit gracefully...
Read more >
Childe Harold's Pilgrimage Summary & Analysis
They left England in 1809 and did not return for two years. ... What am I? Nothing: but not so art thou, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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