-
-
Notifications
You must be signed in to change notification settings - Fork 993
Open
Description
Provide environment information
v4.3.2
Describe the bug
When running trigger dev, .env.local should override values from .env, but it doesn't. The .env values are used instead
Reproduction repo
n/a
To reproduce
To reproduce:
- Create .env with TEST_VAR=from-env
- Create .env.local with TEST_VAR=from-local
- Run npx trigger.dev dev
- In your task, check process.env.TEST_VAR
- It shows from-env instead of from-local
Expected: .env.local should override .env, so TEST_VAR should be from-local.
Additional information
The issue is most probably in packages/cli-v3/src/utilities/dotEnv.ts. The code passes an array to dotenv.config({ path: envFilePath }), but dotenv.config() only accepts a string path, not an array. This means only the first file (.env) is loaded.
Potential fix:
Loop through each file in ENVVAR_FILES and call dotenv.config() for each one in order, so later files override earlier ones
Metadata
Metadata
Assignees
Labels
No labels