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.

on("end", fn ()) does not appear to be working correctly

See original GitHub issue

Someone raised an issue in gulp-jasmine (sindresorhus/gulp-jasmine#69) about the end event, and it seems to be caused by gulp:

gulp.task("default", function (callback) {
    gulp.src("test.spec.js")
        .on("end", function () {
            console.log("We're done!");
            callback();
        });
});

works with gulp@3.7 but stopped working with gulp@3.8.

Returning the pipe:

gulp.task("default", function () {
    return gulp.src("test.spec.js")
        .on("end", function () {
            console.log("We're done!");
        });
});

works as expected. Not sure if I’m missing something (I rarely use callbacks).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
phatedcommented, May 4, 2016

You can return your stream or attach an on('data', noop) handler.

1reaction
phatedcommented, May 4, 2016

Technically a stream that ends with a transform stream (through2) won’t end either. You have to end on a Writable stream. I’m also wondering why you aren’t using 3.9.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to correct a #N/A error in INDEX/MATCH functions
Problem: There is no data to match. When the MATCH function does not find the lookup value in the lookup array, it returns...
Read more >
Top Reasons Why Your VLOOKUP is Not Working, and How ...
Want to find out why your VLOOKUP is not working? This post will outline some of the most common errors and how to...
Read more >
Excel formulas not working, not updating, not calculating
Fixes and solutions for Excel formulas not working. See how to fix a formula that is not calculating or not updating automatically, ...
Read more >
[GA4] Troubleshoot tag setup on your website - Analytics Help
The measurement code is installed incorrectly ; Your website has not received any traffic; Your data is not yet processed. The measurement code...
Read more >
Function Keys Not Working in Windows 10? Here's What to Do
On your keyboard, look for an Fn, F lock, or F Mode key. Depending on your laptop, you should press for one time...
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