Undocumented ```delete process.env.DEBUG``` when variable is empty
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
調査の方向性
Start with the README and the behavior described when the debug package is required before dotenv loads. Document that an empty DEBUG environment variable may be removed, and include the proposed DEBUG=, workaround if appropriate. Done means the README clearly explains this behavior and its effect on later process.env.DEBUG checks.
索引モデルが issue の本文から書いたものです。
説明
I would just like to point out to the fact that when required, debug package will remove the DEBUG env variable if empty.
I think it would be nice if this is mentioned in the readme, as I feel its a non obvious behavior.
The use case I noticed this on is:
command:
npm install dotenv
DEBUG= npx mocha --require bootstrap.js
files:
.env
DEBUG=*
bootstrap.js
console.log(process.env.DEBUG);
require('dotenv').config();
console.log(process.env.DEBUG);
output:
undefined // we lost the DEBUG env already
'*' // we get .env file DEBUG setting, but we should have gotten '', because dotenv never overrides set env variables (* actually after version 4 I believe)
problem:
mocha uses the debug package which deletes the env variable. Our user code in bootstrap.js then has no way of knowing if DEBUG was set to an empty string or not supplied. Therefore we get full debug info instead of none.
More general - any code used before using process.env.DEBUG might delete the env variable through just depending on the debug package.
solution
I propose we either not delete the DEBUG variable or have a section in documentation to explain and suggest maybe using DEBUG=, to disable debug logging.
- 主要言語
- 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
-
curation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
amponce/archive-movie-browser#186 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
clerk/javascript#9852 ·
-
bug p1 tools
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100