-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.permissionIssues and PRs related to the Permission ModelIssues and PRs related to the Permission Model
Description
Version
main
Platform
MacOS
Subsystem
fs
What steps will reproduce the bug?
// node --permission demo.mjs
import fs from "fs"
await fs.promises.mkdtemp('asdf')
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
throw an error: Error: Access to this API has been restricted. Use --allow-fs-write to manage permissions.
What do you see instead?
throw and error: TypeError: Method Promise.prototype.then called on incompatible receiver undefined
.
Additional information
This is because C++ layer does not return the promise to JS layer(just reject the promise in C++ layer) when an error occurs(Libuv error or permission error).
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.permissionIssues and PRs related to the Permission ModelIssues and PRs related to the Permission Model