を返されたものの、私は信号非同期完了エラーIが流れ
Did you forget to signal async completion?
を得ている理由を私は理解することはできません。ここに私の設定です:スタックトレースによると
gulp.task('compile-ts',() => {
return tsProject.src(config.files.src.ts)
.pipe($.tap((file, t) => {
logVerbose('Compiling "' + file.path + "'");
}))
.pipe($.sourcemaps.init())
.pipe($.typescript(tsProject))
.pipe($.sourcemaps.write('./'))
.pipe($.chmod(755))
.pipe(gulp.dest(config.dist));
});
gulp.task('copy-assets',() => {
return gulp.src(config.files.src.css_html_js, { base: config.src })
.pipe($.tap((file, t) => {
logVerbose('Copying "' + getFileName(file.path) + "'");
}))
.pipe($.chmod(755))
.pipe(gulp.dest(config.dist));
});
gulp.task('browser-sync', (done) => {
browserSync.init({
"port": 3000,
"startPath": "dist/index.html",
"browser": "chrome",
"logLevel": "silent",
"server": {
"middleware": {
"0": null
}
}
}, done);
process.on('exit',() => {
browserSync.exit();
});
})
gulp.task('watch', gulp.parallel(() => {
gulp.watch(config.files.ts, gulp.series('compile-ts'));
},() => {
gulp.watch(config.files.css_html_js, gulp.series('copy-assets'));
}));
gulp.task('serve-dist', gulp.parallel('watch', 'browser-sync'));
、問題の行があります
gulp.watch(config.files.ts, gulp.series('compile-ts'));
watch
タスク内。タスクcompile-ts
が動作していて、完了を知らせるのに十分なはずのストリームを返します。しかし、なぜ私はエラーをとらえているのですか?
これは[email protected]
です。
EDIT:
が
gulp.task('watch', (done) => {
gulp.watch(config.files.css_html_js, gulp.series('copy-assets'));
gulp.watch(config.files.ts, gulp.series('compile-ts'));
done();
});
にwatch
タスクを変更する私はもうすべてのエラーを得ることはありませんが、タスクは4msの内に終了し、全く何もしませんさ。 done
部分を削除すると、同じエラーが再び表示されます。
EDIT2:私は両方
gulp.task('watch-ts',() => {
return gulp.watch(config.files.ts, gulp.series('compile-ts'));
});
gulp.task('watch-assets',() => {
return gulp.watch(config.files.css_html_js, gulp.series('copy-assets'));
});
gulp.task('watch', gulp.parallel('watch-ts', 'watch-assets'));
今watch-ts
とwatch-assets
、問題を特定くれというエラーメッセージを出すことができるようにいくつかのより多くのタスクを分割。いずれにしても、私が知る限りストリームが返されます。
可能な重複[がぶ飲みエラー:次の作業は完了しませんでした:あなたは非同期完了を通知することを忘れていましたか?](HTTP別の方法としては、
ignoreInitial
optionそれが最初の起動時に時計をトリガーするgulp.watch()
に渡すことができます://stackoverflow.com/questions/36897877/gulp-error-the-following-tasks-did-not-complete-did-you-forget-to-signal-async) –また、 'tsProject.src() 'ストリームを返しますか? ['gulp.watch()'](https://github.com/gulpjs/gulp/blob/4.0/docs/API.md#gulpwatchglobs-opts-fn)には、文字列または文字列が必要です。 –
修正済み。回答は変更されません。質問を投稿する前に提案された回答をチェックしています。私の意見では、私はストリーム(=あなたの回答項目1)を返しています。 –