-
SummaryWhen placing my .env in my apps folders environment variables load fine. However using .env in my turbo repo root, variables are undefined. I've tried setting "envMode": "loose", in turbo.json, as well as the --env-mode=loose flag in my script. As well as adding the specific environment variables to "globalEnv" in turbo.json as well as task specific "env". Am I missing something? I know its not recommended to use a repo root .env with turbo repo but the docs state "Good to know: You may find it easier to use a root .env file when incrementally migrating to a monorepo. Tools like dotenv can load .env files from different locations." Additional information"turbo": "^2.2.3"ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Turborepo does not load .env files into the environment. Have you set up a tool to do so? |
Beta Was this translation helpful? Give feedback.
Understood. I did read that earlier in the documentation however the note about using a root .env made me assume although turbo itself does not load them, a .env from the root would be accessible by my applications and that dotenv is optional.
So to summarize; place .env files in their respective apps directories. If using a root .env or other location, use dotenv.