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

If dependencies are frozen&locked, Deno shouldn't ask permission to import #27498

Closed
matklad opened this issue Dec 30, 2024 · 0 comments · Fixed by #27530
Closed

If dependencies are frozen&locked, Deno shouldn't ask permission to import #27498

matklad opened this issue Dec 30, 2024 · 0 comments · Fixed by #27530
Labels
permissions related to --allow-* flags suggestion suggestions for new features (yet to be agreed)

Comments

@matklad
Copy link

matklad commented Dec 30, 2024

The following interaction doesn't make sense:

λ deno run --frozen --cached-only --allow-write=./content/posts ./src/main.ts touch "what-is-dependency"
┏ ⚠️  Deno requests import access to "unpkg.com:443".
┠─ Requested by `import()` API.
┠─ To see a stack trace for this prompt, set the DENO_TRACE_PERMISSIONS environmental variable.
┠─ Learn more at: https://docs.deno.com/go/--allow-import
┠─ Run again with --allow-import to bypass this prompt.
┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all import permissions) >
error: Requires import access to "unpkg.com:443", run again with the --allow-import flag
    at file:///Users/matklad/p/matklad.github.io/src/highlight.ts:3:19
matklad@TigerMac ~/p/matklad.github.io (master *) [1]
λ deno run --frozen --cached-only --allow-write=./content/posts ./src/main.ts touch "what-is-dependency"
✅ Granted import access to "unpkg.com:443".
touching ./content/posts/2024-12-30-what-is-dependency.dj

I am running Deno with --frozen and --chached-only, and it succeeds. Hence, it only uses locally cached&checksumed files. It shouldn't be asking me to allow it accessing unpkg as it shouldn't actually be talking to any remote machines in this scenario.

@dsherret dsherret added permissions related to --allow-* flags suggestion suggestions for new features (yet to be agreed) labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
permissions related to --allow-* flags suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants