[英]Gulp error: Did you forget to signal async completion?
Problems with compiling what I see as a simple script using gulp. 使用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. 我希望这不会出错并完成任务。
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"));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.