Skip to content

Node 22 broke readdir on Windows UNC paths #58223

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

Open
felipecrs opened this issue May 7, 2025 · 1 comment
Open

Node 22 broke readdir on Windows UNC paths #58223

felipecrs opened this issue May 7, 2025 · 1 comment
Labels
windows Issues and PRs related to the Windows platform.

Comments

@felipecrs
Copy link

Version

22.15.0

Platform

Microsoft Windows NT 10.0.26100.0 x64

Subsystem

fs

What steps will reproduce the bug?

~\repos\clipboard-sync v0.16.2 ❯ volta run --node 20 node --eval 'console.log(require("fs").readdirSync("S:\\\\"))'  20:09:08 
[ 'FELIPE-DESKTOP.is-receiving.txt' ]

~\repos\clipboard-sync v0.16.2 ❯ volta run --node 22 node --eval 'console.log(require("fs").readdirSync("S:\\\\"))'  20:09:58 
node:fs:1584
  const result = binding.readdir(
                         ^

Error: ENOENT: no such file or directory, scandir 'S:\\'
    at Object.readdirSync (node:fs:1584:26)
    at [eval]:1:27
    at runScriptInThisContext (node:internal/vm:209:10)
    at node:internal/process/execution:449:12
    at [eval]-wrapper:6:24
    at runScriptInContext (node:internal/process/execution:447:60)
    at evalFunction (node:internal/process/execution:87:30)
    at evalScript (node:internal/process/execution:99:3)
    at node:internal/main/eval_string:74:3 {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'scandir',
  path: 'S:\\\\'
}

Node.js v22.15.0

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior? Why is that the expected behavior?

To work, like it always used to.

What do you see instead?

ENOENT.

Additional information

I noticed this when upgraded my application from Electron 34 to 35, which also upgraded Node from 20 to 22. Maybe this is related to:

Whatever was done there may have broken other cases.

@joyeecheung
Copy link
Member

I think it might have been another regression from #52135 cc @nodejs/platform-windows @anonrig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

3 participants