2 months ago
Hi there,
I am using Varlock to manage my variables and encountering various issues. I will start with this one.
I have a monorepo with .env.schema at the root defined as such:
# Shared environment for the monorepo.
# @defaultRequired=infer @defaultSensitive=false
# ---
# Redis connection URL shared by the API producer and worker consumer.
# @type=string
# @required
QUEUE_URL=
# @type=string
# @required
QUEUE_NAME=
Then in my /apps/worker/.env.schema I have:
# @import(../../, pick=[QUEUE_URL, QUEUE_NAME])
# @defaultRequired=infer @defaultSensitive=false
# @generateTsTypes(path=env.d.ts)
# ---
I have set the variables within my service, however the logs are an error (attached).
Where would be the proper place to set these variables?
Pinned Solution
2 months ago
Turborepo uses strict mode by default for env variables, that's why they are empty. You need to either configure env variables in your turbo.json, or enable loose mode instead.
3 Replies
2 months ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • about 2 months ago
darseen
Are you using turborepo?
2 months ago
I am, yes
robertjawoods
I am, yes
2 months ago
Turborepo uses strict mode by default for env variables, that's why they are empty. You need to either configure env variables in your turbo.json, or enable loose mode instead.
Status changed to Solved mayori • about 2 months ago