Skip to content

MWE of a bug in TSX loading of environment variables from files

Notifications You must be signed in to change notification settings

zsiegel92/tsx_env_var_bug_mwe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Issue Description

The .env file looks like this:

ENV_VAR=right # comment after
# ENV_VAR=wrong

Using npx tsx --env-file .env test.ts, the commented-out wrong variable is set during execution rather than the correct one. The conditions for this are:

  • the correct one has a comment after the line where it's defined
  • the wrong one appears below the right one

Run this MWE

npm install
npm run start
# or
npx tsx --env-file .env test.ts

Issue Link

This is a MWE for this GitHub issue on the tsx repo. When that is resolved I'll archive this repo.

About

MWE of a bug in TSX loading of environment variables from files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published