V
V
Vlad2020-12-19 02:14:24
JavaScript
Vlad, 2020-12-19 02:14:24

Why does the build get the error "Did you forget to signal async completion"?

I decided to rewrite the assembly from Gulp 3 to Gulp 4. At the

end I write:

...
function build () {
    return gulp.series(clean_build, 
        gulp.parallel(
            image_build, 
            fonts_build, 
            js_build, 
            css_build, 
            php_build, 
            html_build));
}
// define tasks
exports.html_build = html_build;
exports.php_build = php_build;
exports.css_build = css_build;
exports.js_build = js_build;
exports.fonts_build = fonts_build;
exports.image_build = image_build;
exports.build = build;


I run:
gulp build

I get an error:
[21:01:51] The following tasks did not complete: build
[21:01:51] Did you forget to signal async completion?


I added the async prefix to the functions, but it still gives the same error.
When I use the old syntax with gulp.task, everything works.
What is the secret here?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Lopatin, 2020-12-19
@Vextor-ltd

exports.build = build();

V
Vlad, 2020-12-19
@Vextor-ltd

Forgot to add.
If you register the launch of all tasks like this:

exports.build = gulp.series(
    clean_build, 
    gulp.parallel(image_build, fonts_build, js_build, css_build, php_build, html_build)
);

then everything works. And if you put it in a function, then no. Why?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question