Gulp v5.0.0 does not work if the root folder contains too many files (Works in Gulp v4.0.2)
zivkovic opened this issue · comments
What were you expecting to happen?
The script to work with Gulp v5.0.0
What actually happened?
Gulp v5.0.0 starts up, then throws error RangeError: Maximum call stack size exceeded
.
Please give us a sample of your gulpfile
const { src, dest, parallel, series, watch } = require("gulp");
function streamTask() {
return src(["pdf/**"]);
}
exports.default = streamTask;
Terminal output / screenshots
Please provide the following information:
- OS & version [e.g. MacOS Catalina 10.15.4]: Linux Manjaro 23.1.4
- node version (run
node -v
): v21.7.2 - npm version (run
npm -v
): 10.5.0
Additional information
I created a sample project with the above gulpfile and the following package.json
:
{
"name": "test",
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "gulp"
},
"author": "",
"license": "ISC",
"devDependencies": {
"gulp": "^5.0.0"
}
}
In the root folder I have the following structure:
test/pdf/* // Contains 50 pdf files
test/media/* // Contains approx 84000 random files (images, pdf, videos, etc...)
test/package.json
test/gulpfile.js
Command used to get file count in root folder: find . -type f | wc -l
, result: 84039
If I simply change the gulp version from "gulp": "^5.0.0"
to "gulp": "^4.0.2"
the project works as intended.
This is a duplicate of gulpjs/glob-stream#125, please follow that issue for updates.