docs: `dev --env-file` help/docs say it does not reach tasks, but it does
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- cli, documentation
Direzione di ricerca
Start by reading dev/devSupervisor.ts and the resolveLocalEnvVars → resolveDotEnvVars path mentioned in the issue, then compare it with the dev/deploy/preview CLI help and the three named docs pages. Reproduce with a task reading process.env.PROBE and trigger dev --env-file custom.env; done means the documented contract and actual behavior agree. Two pull requests have already been linked, so check their discussions before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Provide environment information
trigger.dev 4.5.0 (also verified 4.5.9)
Describe the bug
The --env-file option is documented — in the CLI --help for dev/deploy/preview and in the docs pages (cli-dev-commands, cli-deploy-commands, cli-preview-archive) — as:
Load environment variables from a file. This will only hydrate the
process.envof the CLI process, not the tasks.
But in dev, the file is passed through to the tasks. DevSupervisor.#getEnvVars() (dev/devSupervisor.ts) builds the run environment from resolveLocalEnvVars(this.options.args.envFile, …):
async #getEnvVars() {
const environmentVariablesResponse = await this.options.client.getEnvironmentVariables(...);
return {
...resolveLocalEnvVars(this.options.args.envFile, environmentVariablesResponse.success ? ... : {}),
NODE_ENV: "development",
...
};
}
and resolveLocalEnvVars(envFile, …) → resolveDotEnvVars(undefined, envFile) reads exactly that file and includes it in what the task receives via process.env.
To reproduce
echo "PROBE=from-file" > custom.envtrigger dev --env-file custom.env- In a task:
process.env.PROBE - It is
from-file— the task does see the--env-filevalue.
Expected per the docs: the task should NOT see it (docs say the flag only affects the CLI process).
Which is correct?
The behavior (file reaches tasks) is arguably the more useful one — passing --env-file /path/to/empty is a clean way to make the CLI read no ambient .env* files and rely solely on the injected process.env. But the docs and --help text state the opposite, so please either:
- fix the docs/
--helpto say--env-filevalues are included in the task environment, or - if the documented behavior is the intended contract, fix
devto not passenvFileintoresolveLocalEnvVars.
Either way the code and the docs currently disagree, which makes --env-file hard to reason about.
Additional information
Related: #2999 (the .env vs .env.local precedence bug in the same resolveDotEnvVars path).
- Lingua principale
- TypeScript
- Stelle
- 16.5k
- Fork
- 1.5k
- Merge medio
- 1g 15h
- PR unite (30g)
- 17
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di triggerdotdev/trigger.dev
-
bug: retry.fetch ignores the caller's abort signal and retries aborted requestsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
triggerdotdev/trigger.dev#5116 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug: Chat transport crashes on Safari < 17.4: AbortSignal.any is not a functionForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
triggerdotdev/trigger.dev#5098 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug: Side menu items lose their active state on detail pagesForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
triggerdotdev/trigger.dev#5088 ·
I maintainer di solito rispondono entro 1 giorno
-
bug: RBAC loader logs "plugin found but failed to load" when @triggerdotdev/plugins is simply not installedForse di nuovo libera @itsfaryal l’ha presa 17 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
triggerdotdev/trigger.dev#5083 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
triggerdotdev/trigger.dev#5072 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di triggerdotdev/trigger.dev
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug platform-android
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Termix-SSH/Mobile#146 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
devswha/herdr-web-ui#3875 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
area: runtime chore cli consistency dependencies developer-experience difficulty: easy discovery documentation enhancement good first issue help wanted hygiene json-output packaging priority: P3 tests version
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno