Skip to content

Deno.permissions.query({name:"imports"}) is not supported #27050

@lowlighter

Description

@lowlighter

Version: Deno 2.1.1

It's not possible to query --allow-imports descriptor currently

console.log(await Deno.permissions.query({name:"imports"}))
Uncaught TypeError: The provided value "imports" is not a valid permission name
    at Permissions.querySync (ext:runtime/10_permissions.js:211:13)
    at Permissions.query (ext:runtime/10_permissions.js:203:34)
    at <anonymous>:1:57

Possibly just a quick fix to do in:

const permissionNames = [
"read",
"write",
"net",
"env",
"sys",
"run",
"ffi",
];

Edit: the name should probably be import and not imports, to match https://docs.deno.com/api/deno/~/Deno.PermissionOptionsObject

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlypermissionsrelated to --allow-* flags

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions