Server cant read read env variables i set
blackvativ
FREEOP

a year ago

Hello, my Node.js application is unable to read the environment variables I have set in the dashboard. My code uses process.env.BOG_CLIENT_ID, but the server logs show that the value is undefined. Can you please help me understand why the variables are not being injected into my deployment?

$10 Bounty

5 Replies

Railway
BOT

a year ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


blackvativ
FREEOP

a year ago

anyone here???


jonathanthedeveloper
FREE

a year ago

What package manager are you using ?


a year ago

try using BOG_CLIENT_ID in your variable and not process.env.BOG_CLIENT_ID


turborx
FREE

a year ago

hi, after you add BOG_CLIENT_ID in your Railway project’s Variables settings you need to redeploy/restart your service so the new env vars get injected at runtime. also make sure you don’t have a local .env or dotenv call overriding production Railway injects them for you. once you redeploy, process.env.BOG_CLIENT_ID should no longer be undefined.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...