Skip to content

fix(cli): send debug diagnostics to stderr - #1081

Merged
motdotla merged 3 commits into
motdotla:masterfrom
wozhenbang2004:fix/cli-debug-stderr
Nov 9, 2026
Merged

motdotla merged 3 commits into
motdotla:masterfrom
wozhenbang2004:fix/cli-debug-stderr

Conversation

@wozhenbang2004

Copy link
Copy Markdown
Contributor

With --debug, dotenv run can write its own file-loading and variable-conflict diagnostics to the child command's stdout. Consumers parsing that output as JSON receive diagnostic text before the JSON.

Send the CLI diagnostics to stderr and preserve the library logger defaults. The regressions cover a missing default .env file and an environment variable that is already set. Both fail on the unmodified CLI.

npm test completed with 1,424 assertions passed and one Windows-only test skipped.

@motdotla
motdotla merged commit 849e592 into motdotla:master Nov 9, 2026
8 checks passed
@motdotla

motdotla commented Nov 9, 2026

Copy link
Copy Markdown
Owner

thanks @wozhenbang2004. merged. i'm going to also just move all to stderr. this was an oversight when moving to 18 which was meant to go full stderr for diagnostics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants