gulpjs / gulp

A toolkit to automate & enhance your workflow

Home Page:https://gulpjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RangeError: Maximum call stack size exceeded

cbratschi opened this issue · comments

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:

  • OS & version [e.g. MacOS Catalina 10.15.4]: macOS Sonoma 14.4.1
  • node version (run node -v): v20.11.1
  • npm version (run npm -v): 10.2.4
  • gulp version (run gulp -v): 5.0.0

Going to close this here as a duplicate - follow gulpjs/glob-stream#125 for updates!