You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the readme, the path option should accept an array
path
Default: path.resolve(process.cwd(), '.env')
By default, config will look for a file called .env in the current working directory. Pass in multiple files as an array, and they will be loaded in order. The first value set for a variable will win. require('dotenv').config({ path: ['.env.local', '.env'] })
It does not seem to be working properly
In this snippet, process.env.TEST is undefined when using path: [".env"]
console.log("Loading with array");
require("dotenv").config({ path: [".env"] });
console.log(process.env.TEST);
console.log("Loading with path");
require("dotenv").config({ path: ".env" });
console.log(process.env.TEST);
Output:
Loading with array
undefined
Loading with path
test
tests should have caught this, which means a bad test. it's using mocking - always brittle. i'm rearranging the tests to confirm and then will check out your pr. thank you.
According to the readme, the
path
option should accept an arrayIt does not seem to be working properly
In this snippet,
process.env.TEST
is undefined when usingpath: [".env"]
Output:
SANDBOX
The text was updated successfully, but these errors were encountered: