You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It does catch some error but not the expected one.
node index.mjs
.catch TypeError: Cannot destructure property '0' of 'undefined' as it is undefined.
at getDirents (node:internal/fs/utils:249:32)
at node:internal/util:442:7
at new Promise (<anonymous>)
at getDirents (node:internal/util:428:12)
at Object.readdir (node:internal/fs/promises:864:5)
at async file:///<redact>/index.mjs:4:3
node:internal/fs/promises:857
const result = await binding.readdir(
^
Error: ENOENT: no such file or directory, scandir
at Object.readdir (node:internal/fs/promises:857:32)
at file:///<redact>/index.mjs:5:6
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:113:12) {
errno: -4058,
code: 'ENOENT',
syscall: 'scandir'
}
Node.js v20.10.0
It can be reproduced on my Windows from v20.4.0. as mentioned in #48673 (comment), that maybe because that libuv introduced WTF-8. and as mentioned in #48673 (comment) , it has been fixed since v21.5.0
Since this issue has not been active in over a year and there are currently LTS versions that have a fix, I'll close it. If needed, feel free to reopen.
Activity
[-]`try catch` not work if path include utf16 character[/-][+]`try catch` not work if path include unicode[/+]targos commentedon Feb 19, 2024
I can't reproduce on macOS.
climba03003 commentedon Feb 19, 2024
Reproducible on Windows.
It does catch some error but not the expected one.
kylo5aby commentedon Feb 19, 2024
It can be reproduced on my Windows from v20.4.0. as mentioned in #48673 (comment), that maybe because that libuv introduced WTF-8. and as mentioned in #48673 (comment) , it has been fixed since v21.5.0
AlttiRi commentedon Feb 19, 2024
This breaking regression bug is still not fixed in 20.x "LTS" while it was fixed in "Current" 21.x in December, 2 months ago.
I noted it in multiple issues and PRs.
StefanStojanovic commentedon Mar 27, 2025
Since this issue has not been active in over a year and there are currently LTS versions that have a fix, I'll close it. If needed, feel free to reopen.
felipecrs commentedon May 7, 2025
Whatever was done here may have broken some other cases:
readdiron Windows UNC paths #58223