gulpjs / gulp

A toolkit to automate & enhance your workflow

Home Page:https://gulpjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v5 : Series tasks fail where running individually pass

ps-mattstuart opened this issue · comments

What were you expecting to happen?

Running a task defined as a series to pass the same as running the tasks from command line

What actually happened?

When running as a series the tasks fail.

[17:45:04] The following tasks did not complete: ab, b
Did you forget to signal async completion?

Please give us a sample of your gulpfile

/* VERSION 1 */
let gulp = require("gulp");
let rename = require("gulp-rename");

gulp.task('a', () => {
    return gulp.src('gulpfile.js')
        .pipe(rename('gulpfile.js.one'))
        .pipe(gulp.dest('_out'))
})
gulp.task('b', () => {
    return gulp.src('gulpfile.js')
        .pipe(rename('gulpfile.js.two'))
        .pipe(gulp.dest('_out'))
})
gulp.task('ab', gulp.series('a', 'b'))
/* VERSION 2 */
let gulp = require("gulp");
let rename = require("gulp-rename");

function a() {
    return gulp.src('gulpfile.js')
        .pipe(rename('gulpfile.js.one'))
        .pipe(gulp.dest('_out'))
}
function b() {
    return gulp.src('gulpfile.js')
        .pipe(rename('gulpfile.js.two'))
        .pipe(gulp.dest('_out'))
}
exports.a = a
exports.b = b
exports.ab = gulp.series(a, b)

Terminal output / screenshots

$ gulp a
[17:44:33] Using gulpfile .../gulpfile.js
[17:44:33] Starting 'a'...
[17:44:35] Finished 'a' after 1.99 s
$ gulp b
[17:44:33] Using gulpfile .../gulpfile.js
[17:44:33] Starting 'b'...
[17:44:35] Finished 'b' after 1.98 s
$ gulp a b
[17:44:50] Using gulpfile .../gulpfile.js
[17:44:50] Starting 'a'...
[17:44:50] Starting 'b'...
[17:44:52] Finished 'a' after 2.23 s
[17:44:52] Finished 'b' after 2.23 s
gulp ab
[17:45:01] Using gulpfile .../gulpfile.js
[17:45:01] Starting 'ab'...
[17:45:01] Starting 'a'...
[17:45:03] Finished 'a' after 2.6 s
[17:45:03] Starting 'b'...
[17:45:04] The following tasks did not complete: ab, b
Did you forget to signal async completion?
node:internal/process/report:91
  set reportOnUncaughtException(trigger) {
                               ^

RangeError: Maximum call stack size exceeded
    at set reportOnUncaughtException [as reportOnUncaughtException] (node:internal/process/report:91:32)
    at setUncaughtExceptionCaptureCallback (node:internal/process/execution:106:46)
    at updateExceptionCapture (node:domain:179:5)
    at Domain.enter (node:domain:325:3)
    at EventEmitter.emit (node:domain:551:10)
    at processDirents (node_modules/glob-stream/index.js:88:10)
    at next (node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (node_modules/once/once.js:25:25)
    at processDirents (node_modules/glob-stream/index.js:113:7)

Node.js v18.17.1

Please provide the following information:

  • Linux dev-vagrant 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:37:39 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
  • node -v : v18.17.1
  • npm -v : 10.5.0
  • gulp:
gulp -v
CLI version: 3.0.0
Local version: 5.0.0

Additional information

I fully accept that I might be doing the series thing wrong. I have tried with not using the string version of my tasks instead supplying functions but I get the same effect.

NOTE: Changing series() to parallel() results in successful runs!

It looks like you didn't include the entire stack trace, which seems to indicate something bigger of a problem. Please provide the entire trace

Fullstack added but i'm testing more.. a completely fresh project doesn't appear to have the same issues. Continuing with diagnoses..

This is a duplicate of gulpjs/glob-stream#125

We're still working on a fix

Going to close these, please follow gulpjs/glob-stream#125 for updates