Environment Variables Not Loading in Deployment
vialsmasher
FREEOP

a year ago

Not receiving any environment variables at runtime.

I've set variables like SUPABASE_JWT_SECRET and a test variable ECHO_TEST in the service's "Variables" tab, but my application logs show that process.env.ECHO_TEST is undefined on startup. The build log shows a successful build, but the deploy log confirms the variables are missing? And the application fails.

Can you please investigate why the variables are not being injected into my container?

Solved$10 Bounty

Pinned Solution

a year ago

You have not applied the changes after adding the variables.

Attachments

8 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!


a year ago

Hey!

Just want to verify the simple things.

Did you redeploy after setting variables?

Have you possibly mistyped any of them?

Might not be the case but always like to check the simple things! Have made that mistake many times haha


vialsmasher
FREEOP

a year ago

No worries - wouldn't shock me if it was still on my end. I have redeployed and checked everything over ad nauseum this morning so im 90% sure my variables are correct. My simple echo test seems to suggest nothing is getting through since my deploy log shows undefined.


a year ago

Well hmmm,

I assume you’re using javascript/ts from the process.env. Are you using the dotenv package to read the env?


vialsmasher
FREEOP

a year ago

You were definitely on the right track - I did find a stray dotenv from my start up. Removed it, redeployed and still the exact same problem...variables not coming through. Echo test is still showing undefined. Seems like they are not being injected into the container for whatever reason. Thinking i might just delete and try again at this point?


a year ago

You have not applied the changes after adding the variables.

Attachments


a year ago

That'll do it!


vialsmasher
FREEOP

a year ago

Lol, works. New things to debug but we are done here and im embarrassed.


Status changed to Solved noahd 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...