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.

G4 - Did you forget to signal async completion?

See original GitHub issue

Hello, in the process of transitioning from G3 to G4 and I’ve ran into a snag with one of my tasks. I’ve tried a standard function and gulp.series() with no luck. Both tasks bark out:

The following tasks did not complete: svg-2-png
[09:17:32] Did you forget to signal async completion?

Tasks:

function svg2png(done){
    return gulp.src(appDefaults.imagesDir+"/*.svg")
        .pipe(svg2png())
        .pipe(gulp.dest(appDefaults.imagesDir+'/fallbacks'));
        done();
}
gulp.task('svg2png', gulp.series(function(done){
    gulp.src(appDefaults.imagesDir+"/*.svg")
        .pipe(svg2png())
        .pipe(gulp.dest(appDefaults.imagesDir+'/fallbacks'));
        done();
}));

gulp.task('svg-2-png',svg2png);

I think this is going to be something documentation could help for folks like me moving from 3 to 4. I read blog posts about this but don’t see any reference to done(); in readme 😉

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
yocontracommented, Apr 20, 2016

Just return the stream, you don’t need to call the callback at all.

function svg2png(){
    return gulp.src(appDefaults.imagesDir+"/*.svg")
        .pipe(svg2png())
        .pipe(gulp.dest(appDefaults.imagesDir+'/fallbacks'));
}

If you were doing something that didn’t have a stream, you can use the callback to signal done instead of returning a stream. You never do more than one.

0reactions
phatedcommented, Jul 10, 2017

@jackesdavid that is not the appropriate fix. Even if you improperly use those methods inside functions, you need to pass the callbackA to the invocation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gulp error: The following tasks did not complete - Stack Overflow
HTTP Server Started [14:14:41] The following tasks did not complete: message [14:14:41] Did you forget to signal async completion? I'm using gulp 4...
Read more >
Async Completion - gulp.js
No synchronous tasks​​ When you see the "Did you forget to signal async completion?" warning, none of the techniques mentioned above were used....
Read more >
How to fix: Gulp - tasks did not complete ... you forget to signal ...
Now your Gulp task should run without the tasks did not complete and you forget to signal async completion warning lines.
Read more >
Почему gulp (v4) выдает "Did you forget to signal async ...
Почему gulp (v4) выдает «Did you forget to signal async completion?»? Всем привет! Gulpfile.js: 'use strict'; const gulp = require ...
Read more >
Gulp error: Did you forget to signal async completion?
Gulp error: Did you forget to signal async completion? ... I had the following gulpfile.js : # file gulpfile.js function build() { return...
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