gulpjs / gulp

A toolkit to automate & enhance your workflow
https://gulpjs.com
MIT License
33.02k stars 4.23k forks source link

RangeError: Maximum call stack size exceeded #2774

Closed cbratschi closed 7 months ago

cbratschi commented 7 months ago

gulp.src('/abc/src/styles/bootstrap5/env.scss') fails with a "RangeError: Maximum call stack size exceeded" error in anymatch after upgrading to Gulp 5.x. We are not using a gulpfile in this case, we just import the gulp package and use gulp.src() with a single src file.

Complete error:

RangeError: Maximum call stack size exceeded
    at /abc/node_modules/anymatch/index.js:94:12
    at EventEmitter.onPath (/abc/node_modules/glob-stream/index.js:270:20)
    at EventEmitter.emit (node:events:518:28)
    at EventEmitter.emit (node:domain:488:12)
    at processDirents (/abc/node_modules/glob-stream/index.js:88:10)
    at next (/abc/node_modules/now-and-later/lib/mapSeries.js:43:5)
    at handler (/abc/node_modules/now-and-later/lib/mapSeries.js:57:9)
    at f (/abc/node_modules/once/once.js:25:25)
    at processDirents (/abc/node_modules/glob-stream/index.js:113:7)
    at next (/abc/node_modules/now-and-later/lib/mapSeries.js:43:5)

Node.js v20.11.1

Sample code:

import gulp from 'gulp';

const { src, dest } = gulp;

const promiseStream = stream => new Promise((resolve, reject) => {
    stream
        .on('end', resolve)
        .on('finish', resolve)
        .on('error', reject);
});

await promiseStream(gulp.src('/abc/src/styles/bootstrap5/env.scss'));

Please provide the following information:

phated commented 7 months ago

Duplicate of https://github.com/gulpjs/glob-stream/issues/125

yocontra commented 7 months ago

Going to close this here as a duplicate - follow https://github.com/gulpjs/glob-stream/issues/125 for updates!