Problem when using a library that uses `debug` in Deno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- deno, javascript
- Ambito
- tooling
Direzione di ricerca
Start by inspecting src/node.js around line 124, where the issue's Deno stack trace shows environment access during module loading. Trace the module-load path and existing tests for Node-compatible environment handling. Done means importing debug in Deno no longer accesses process.env on module load or requires env permission.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I use jsdom in a project in Deno. jsdom uses debug as a dependency:
└─┬ jsdom@25.0.1
├─┬ http-proxy-agent@7.0.2
│ ├─┬ agent-base@7.1.1
│ │ └── debug@4.3.7 deduped
│ └── debug@4.3.7
└─┬ https-proxy-agent@7.0.5
└── debug@4.3.7 deduped
Deno asks for permission for access to environment variables. Unfortunately debug accesses process.env directly and on requiring the module itself which leads to the following request by Deno.
┏ ⚠️ Deno requests env access.
┃ ├─ Object.toObject (ext:runtime/30_os.js:134:12)
┃ ├─ Object.ownKeys (ext:deno_node/_process/process.ts:54:40)
┃ ├─ Function.keys (<anonymous>)
┃ ├─ Object.<anonymous> (file:///home/krlwlfrt/work/krlwlfrt/calendar/node_modules/debug/src/node.js:124:30)
┃ ├─ Object.<anonymous> (file:///home/krlwlfrt/work/krlwlfrt/calendar/node_modules/debug/src/node.js:267:4)
┃ ├─ Module._compile (node:module:745:34)
┃ ├─ loadMaybeCjs (node:module:770:10)
┃ ├─ Object.Module._extensions..js (node:module:755:12)
┃ ├─ Module.load (node:module:662:32)
┃ └─ Function.Module._load (node:module:534:12)
┠─ Learn more at: https://docs.deno.com/go/--allow-env
┠─ Run again with --allow-env to bypass this prompt.
┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions) >
This goes against the principle of least privilege. Denying the request leads to an exception, because the code can't handle a rejection of that request with Deno's API.
Long story short: Could you please change the behaviour of your library, so that the process.env is not accessed on module load?
- Lingua principale
- JavaScript
- Stelle
- 11.5k
- Fork
- 992
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di debug-js/debug
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Debug as JSON Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 28/100
Tutte le issue di debug-js/debug
Issue simili
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#30750 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Mend: dependency security vulnerability untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100