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.
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:Run the testcase:
node --env-file=.env -e 'console.log(process.env.VAR)'The output is
secondinstead offirst.Adding a non-commented variable after
# SOMETHINGmakes 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
.envis 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
firstin console.