问题
Problems with compiling what I see as a simple script using gulp. When ran it causes a "Did you forget to signal async completion?" error.
Looking at the internet this seems to be a problem with async functions and read that passing and adding the done function would resolve this. In my case this isn't the case so wondering what else I'm doing wrong.
gulp.task("compile-less", done => {
gulp
.src("./app/design/frontend/Playsports/theme_frontend_base/web/css/_base.less")
.pipe(less())
.pipe(
gulp.dest(() => {
return "./pub/static/frontend/Playsports/gcn/en_GB/css/";
})
);
done();
});
gulp.task("default", done => {
gulp.series("compile-less");
done();
});
I would expect this to not error and complete the task.
回答1:
This would be the general form:
gulp.task("default", gulp.series("compile-less", done => {
// do something else here
done();
}));
In your case I believe this is sufficient:
gulp.task("default", gulp.series("compile-less"));
来源:https://stackoverflow.com/questions/57095013/gulp-error-did-you-forget-to-signal-async-completion