Answer the question
In order to leave comments, you need to log in
Gulp 4 gives "The following tasks did not complete... Did you forget to signal async completion". How to fix it?
Hi all !
gulpfile.js:
const gulp = require('gulp'),
gp = require('gulp-load-plugins')();
gulp.task('img:compress', gulp.series( function(cb) {
return gulp.src('img/*')
.pipe(gp.tinypng('RJnL6Rx3l41Y58OJziMBRUeoteR09LBb'))
.pipe(gulp.dest('compressed_img/'))
cb();
}));
[19:11:08] The following tasks did not complete: img:compress, <anonymous>
[19:11:08] Did you forget to signal async completion?
Answer the question
In order to leave comments, you need to log in
You have a call cb()
after return
i.e. it is not called at all. But since it is in the list of arguments, gulp is waiting for its call and, without waiting, swears.
In your case, cb
it is not needed at all, just remove it from the list of arguments and everything will start working.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question