process.env variable returns undefined

I have my project, and I'm trying to get variables from it, I have declared it in the "Variables" section, but it just returns "undefined" when I try to run it
No description
Solution:
are you using railway run? if not, thats what you would want to be using for this usecase
Jump to solution
15 Replies
Percy
Percy6mo ago
Project ID: c79bd679-e479-4c34-b56d-1acc8c93dfc0
KChammas
KChammasOP6mo ago
c79bd679-e479-4c34-b56d-1acc8c93dfc0
KChammas
KChammasOP6mo ago
No description
Brody
Brody6mo ago
are you attempting to use these variables at build or deploy
KChammas
KChammasOP6mo ago
I'm trying to use it running locally Just the yarn run start
Solution
Brody
Brody6mo ago
are you using railway run? if not, thats what you would want to be using for this usecase
KChammas
KChammasOP6mo ago
hmmm I don't thibk so Just run railway run?
Brody
Brody6mo ago
do you think you could share why these variables would become available locally purely by setting them on railway?
KChammas
KChammasOP6mo ago
It's been a while since I don't use railway, I'm coming back to it just now, but got the idea Sorry
Brody
Brody6mo ago
that would be quite the backdoor railway would have if they could magically set environment variables on your computer without you doing anything
KChammas
KChammasOP6mo ago
HAHAHAHA That's true I was kinda confused actually, but I was hoping some magic could happen ahahaha] Thanks, it's working now
Brody
Brody6mo ago
you might be coming back to to railway but your brain has yet to arrive at the station
KChammas
KChammasOP6mo ago
always should run railway run yarn run start, then?
Brody
Brody6mo ago
correct
KChammas
KChammasOP6mo ago
Sure sure hahaha Thanks
Want results from more Discord servers?
Add your server