Problem when using a library that uses `debug` in Deno
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- deno, javascript
- 領域
- tooling
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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?
- 主要言語
- JavaScript
- スター
- 11.5k
- フォーク
- 992
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
debug-js/debug のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
Debug as JSON オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 28/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
nightscout/nocturne#1414 ·
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
modelcontextprotocol/inspector#2458 · コメント 1 件 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
carbon-design-system/ibm-products#9907 ·