Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Map maximum size exceeded - 2^24 file limit? #614

Open
edtan-caseware opened this issue Oct 26, 2024 · 0 comments
Open

RangeError: Map maximum size exceeded - 2^24 file limit? #614

edtan-caseware opened this issue Oct 26, 2024 · 0 comments

Comments

@edtan-caseware
Copy link

Hi, I have a long-running process using glob, and over time, it scans through lots of files. Eventually, we get the following error:

/home/ed/node_modules/path-scurry/dist/commonjs/index.js:108
    normalizeCache.set(s, n);
                   ^

RangeError: Map maximum size exceeded
    at Map.set (<anonymous>)
    at normalize (/home/ed/node_modules/path-scurry/dist/commonjs/index.js:108:20)
    at new PathBase (/home/ed/node_modules/path-scurry/dist/commonjs/index.js:319:60)
    at new PathPosix (/home/ed/node_modules/path-scurry/dist/commonjs/index.js:1264:9)
    at PathPosix.newChild (/home/ed/node_modules/path-scurry/dist/commonjs/index.js:1282:16)
    at #readdirAddNewChild (/home/ed/node_modules/path-scurry/dist/commonjs/index.js:842:28)
    at #readdirAddChild (/home/ed/node_modules/path-scurry/dist/commonjs/index.js:837:37)
    at /home/ed/node_modules/path-scurry/dist/commonjs/index.js:1006:42
    at node:fs:187:23
    at node:internal/util:519:12
    at getDirents (node:internal/fs/utils:286:7)
    at req.oncomplete (node:fs:1479:7)

It looks like this is happening because of this global normalizeCache variable: https://github.com/isaacs/path-scurry/blob/main/src/index.ts#L177, which never gets cleared. Is there a way that the cache can be cleared?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant