Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno run throws error to use --allow-read flag even after passing #27490

Open
niteshbalusu11 opened this issue Dec 29, 2024 · 3 comments
Open
Labels
bug Something isn't working correctly

Comments

@niteshbalusu11
Copy link

Version: Deno 2.1.2

This is my deno.json file. I am using protobuf-js to generate JS and TS files.

{
  "nodeModulesDir": "auto",
  "tasks": {
    "dev": "deno run -A --unsafely-ignore-certificate-errors --watch src/main.ts --config-path /Users/niteshchowdharybalusu/Documents/zbd/lightning-interceptor-service/config.toml",
    "gen-proto": "pbjs -t static-module --keep-case -w es6 -o src/compiled.js protos/lightning.proto",
    "gen-ts": "pbts -o src/compiled.d.ts src/compiled.js"
  },
  "imports": {
    "@eznix/try": "npm:@eznix/try@^2.0.7",
    "@std/assert": "jsr:@std/assert@1",
    "@std/cli": "jsr:@std/cli@^1.0.8",
    "@std/encoding": "jsr:@std/encoding@^1.0.5",
    "@std/fs": "jsr:@std/fs@^1.0.6",
    "@std/toml": "jsr:@std/toml@^1.0.2",
    "lightning": "npm:lightning@^10.22.2",
    "protobufjs": "npm:protobufjs@^7.4.0",
    "protobufjs-cli": "npm:protobufjs-cli@^1.1.3",
    "zod": "npm:zod@^3.23.8"
  },
  "lint": {
    "rules": {
      "exclude": ["no-explicit-any"]
    }
  }
}

What is weird here is, deno run gen-proto works fine. But when I run deno run gen-ts it throws the following error:

I have tried deno run --allow-read gen-ts and deno run -A gen-ts and it still throws the same.

Screenshot 2024-12-29 at 6 04 33 AM
@dsherret
Copy link
Member

What's pbts? deno run gen-ts is just running the task pbts -o ...etc... so what's being run and erroring is the pbts command.

@niteshbalusu11
Copy link
Author

Its just protobufjs CLI for outputting a TS file. Here's the docs. I thought it could be a protobufjs-cli bug but then I tested with nodejs and it works fine.

https://github.com/protobufjs/protobuf.js/tree/master/cli#pbts-for-typescript

@dsherret
Copy link
Member

Ah, ok it's via the protobufjs-cli npm package. Something strange is going on here.

@dsherret dsherret added the bug Something isn't working correctly label Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

2 participants