Environment Variables Not Loading in Deployment
vialsmasher
FREEOP

2 months 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

8 Replies

Railway
BOT

2 months 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!


noahd
EMPLOYEE

2 months 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

2 months 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.


noahd
EMPLOYEE

2 months 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

2 months 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?


brody
EMPLOYEE

2 months ago

You have not applied the changes after adding the variables.

Attachments


noahd
EMPLOYEE

2 months ago

That'll do it!


vialsmasher
FREEOP

2 months ago

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


Status changed to Solved noahd 2 months ago


Loading...