Skip to content

NotCapable: Requires env access to "Symbol(Deno.customInspect)" #30905

@Lohann

Description

@Lohann

Version: Deno 2.5.2

deno --version
# deno --version
deno 2.5.2 (stable, release, aarch64-apple-darwin)
v8 14.0.365.5-rusty
typescript 5.9.2

file: main.ts

console.log(globalThis.process);

Then run deno --deny-env ./main.ts

[Internal Formatting Error] NotCapable: Requires env access to "Symbol(Deno.customInspect)", run again with the --allow-env flag
    at Object.getEnv [as get] (ext:deno_os/30_os.js:124:10)
    at denoEnvGet (ext:deno_node/_process/process.ts:27:21)
    at Object.has (ext:deno_node/_process/process.ts:68:32)
    at has (<anonymous>)
    at formatValue (ext:deno_console/01_console.js:475:7)
    at formatProperty (ext:deno_console/01_console.js:1650:11)
    at formatRaw (ext:deno_console/01_console.js:960:9)
    at formatValue (ext:deno_console/01_console.js:545:10)
    at inspectArgs (ext:deno_console/01_console.js:3074:17)
    at console.log (ext:deno_console/01_console.js:3143:7)

I don't want NodeJS globals to be imported in this project... and I can't find a way to avoid that, I already tried:

  • change the compilerOptions in the deno.json
  • run using DENO_COMPAT=0 deno --deny-env ./main.ts
  • create a .env file then use --env-file=.env..
  • change the compilerOptions.lib
    Nothing worked...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions