Varlock Inherited Variables
robertjawoods
HOBBYOP

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?

image.png

image.png

Solved$10 Bounty

Pinned Solution

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

Railway
BOT

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


Are you using turborepo?


darseen

Are you using turborepo?

robertjawoods
HOBBYOP

2 months ago

I am, yes


robertjawoods

I am, yes

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


Welcome!

Sign in to your Railway account to join the conversation.

Loading...