-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Open
Description
Found while looking at #60559
Both options are documented, and it's not mentioned that they can't be combined
> fs.readdirSync('.', { recursive: true, encoding: 'buffer' })
Uncaught:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Buffer
at Object.join (node:path:1339:7)
at handleFilePaths (node:fs:1421:35)
at processReaddirResult (node:fs:1400:92)
at read (node:fs:1460:5)
at readdirSyncRecursive (node:fs:1468:5)
at Object.readdirSync (node:fs:1542:12) {
code: 'ERR_INVALID_ARG_TYPE'
}
> await fs.promises.readdir('.', { recursive: true, encoding: 'buffer' })
Uncaught:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Buffer
at Object.join (node:path:1339:7)
at readdirRecursive (node:internal/fs/promises:920:39)
at async REPL3:1:33 {
code: 'ERR_INVALID_ARG_TYPE'
}Metadata
Metadata
Assignees
Labels
No labels