Composing tasks with series
function
#2694
-
Before you open this issue, please complete the following tasks:
What were you expecting to happen?The series task to complete successfully. What actually happened?Fails with error in screenshot: "Did you forget to signal async completion?" Please give us a sample of your gulpfileimport gulp from 'gulp'
export const someTaskA = function someTaskA(cb) {
cb()
}
export const someTaskB = () => Promise.resolve()
export const someTaskC = () => gulp.src('test-file').pipe(gulp.dest('tmp'))
export const test = () => gulp.series(someTaskA) Terminal output / screenshotsPlease provide the following information:
Additional informationI see many people have had similar error messages, so I tried to break it down into the simplest case(s). I'm using ESM style whereas most examples I see are in CJS. Do I really have something wrong with these tasks? They work fine individually, but just not when invoked individually (any of them) in a series. I switched over to ESM from CJS style because one of the gulp plugins (that I've been using) requires it now. I wondering if I'm running into a case similar to the "forward references" and if so, what is the right syntax here because I've tried so many variations without success. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
export const test = () => gulp.series(someTaskA)
is incorrect. Gulp'sseries
andparallel
are composition functions and you should not be wrapping them in another function. e.g.export const test = gulp.series(someTaskA)