Hi! First of all I wanna sayu that Railway is such a nice platform and it makes project prototyping and deployment so easy. Unfortunately I have a problem regarding a Next.JS app that I have deployed on Railway. I'm setting the environment variables from within the Railway platform for the app, but unfortunately it seems that I cannot access them from process.env.<name_of_the_environment_variable> from within the code. I am not using a Dockerfile. Does somebody have any ideas? Thanks!
#Help with regard to environment variables in a Next.JS project
9 messages · Page 1 of 1 (latest)
Please provide your project ID or reply with N/A. Thread will automatically be closed if no reply is received within 10 minutes. You can copy your project's id by pressing Ctrl/Cmd + K -> Copy Project ID.
I could be completely wrong, but for next, don't variables have to be prefixed with NEXT_ ?
I think this explains it pretty good
https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables
No project ID was provided. Closing thread.
I think if you want them to be displayed in the front-end app, then you have to use NEXT_PUBLIC_ as a prefix, but I don't think it is related to my problem. I have tried setting the variables either way, and my code doesn't work when I try to access them in my app as process.env.<variable_name>
^
I'm familiar with the link, but I don't see the point, maybe you can elaborate more?
please familiarize yourself with the technologys you are using