-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.dotenvIssues and PRs related to .env file parsingIssues and PRs related to .env file parsing
Description
Version
v21.7.1
Platform
Darwin gray.local 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:45:49 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6020 arm64
Subsystem
env parser
What steps will reproduce the bug?
Create .env
:
VAR=first
# SOMETHING=else
# VAR=second
Run the testcase:
node --env-file=.env -e 'console.log(process.env.VAR)'
The output is second
instead of first
.
Adding a non-commented variable after # SOMETHING
makes the parser work correctly.
How often does it reproduce? Is there a required condition?
100% reproduction
What is the expected behavior? Why is that the expected behavior?
Commented-out line of .env
is ignored.
What do you see instead?
Commented-out part is parsed and the variable value is overwritten.
Additional information
env parser works correctly in 21.6.2, emitting first
in console.
felixfbecker, verekia, polys, iamsbro, anuj-kr-jha and 4 more
Metadata
Metadata
Assignees
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.dotenvIssues and PRs related to .env file parsingIssues and PRs related to .env file parsing