Environment variables not passing through to turbo command as described in documentation #7056
Replies: 3 comments 1 reply
-
I don't see anything obviously wrong with your setup. If you don't see the same issue with running |
Beta Was this translation helpful? Give feedback.
-
Closing for staleness. |
Beta Was this translation helpful? Give feedback.
-
I had the same problem in a Docker image that I use for my Turbo monorepo. The environment variables are not passed to node when I use “turbo run dev” and start all monorepo projects in parallel. The solution was to enter the variables used for the respective script (e. g. dev) in turbo.json, as described in https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#adding-environment-variables-to-task-hashes. In this example
|
Beta Was this translation helpful? Give feedback.
-
I've been trying to get
dotenv-cli
working as per the suggested setup on Turborepo's monorepo handbook. I've got the followingpackage.json
:I get a very odd error in my terminal when running
pnpm build
,pnpm dev
, or any of the other commands withdotenv --
:Of course, I could just pass the
--remote-only
flag, but then I get the same warning about the--summarize
flag. Without attaching every flag that Turborepo's CLI offers, how can I fix this?A few interesting notes/things I've already tried:
npm
oryarn
instead returns the same resultdotenv ...
instead ofdotenv -- ...
returns the same resultpnpm dev
and any other the other commands returns the same result aspnpm build
- it's not isolated to thebuild
scriptdotenv-cli
andturbo
1-3 minor versions each returns the same resultnode_modules
folder and runningpnpm install
again returns the same resultturbo run build
works perfectly, but then it doesn't include the environment variables in the builddotenv -- pnpx cowsay hello
works perfectly fine, so I don't think this has to do withdotenv-cli
so much asturbo
not using its default flags correctly when unspecifiedBeta Was this translation helpful? Give feedback.
All reactions