-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.
Description
Version
v24.0.1
Platform
Darwin 24.4.0 Darwin Kernel Version 24.4.0: Fri Apr 11 18:34:14 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T8122 arm64
Subsystem
fs
What steps will reproduce the bug?
touch a.txt
ln -s a.txt b.txt
node -e "console.log(require('fs').globSync('**/*.txt'))" // ok
node -e "Array.fromAsync(require('fs/promises').glob('**/*.txt'))" // failHow often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
It should work and return those entries like globSync
What do you see instead?
TypeError: Cannot read properties of null (reading 'length')
at #iterateSubpatterns (node:internal/fs/glob:627:34)
at async Glob.glob (node:internal/fs/glob:540:9)
at async Object.glob (node:internal/fs/promises:1266:3)
Additional information
See:
Lines 624 to 627 in 5f841fb
| children = await this.#cache.readdir(fullpath); | |
| } | |
| for (let i = 0; i < children.length; i++) { |
Lines 140 to 148 in 5f841fb
| async readdir(path) { | |
| const cached = this.#readdirCache.get(path); | |
| if (cached) { | |
| return cached; | |
| } | |
| const promise = PromisePrototypeThen(readdir(path, { __proto__: null, withFileTypes: true }), null, () => null); | |
| this.#readdirCache.set(path, promise); | |
| return promise; | |
| } |
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.