R
Railway

✋|help

Nextjs 13 Environmental variable

Ddouble_ducker8/24/2023
Hello!

I recently installed Nextjs to try out the "new" app directory, because I heard server actions are cool.
I am using a Dockerfile to deploy, and before I run the build command, I also inject the env variables like this:

ARG tmp
ENV NEXT_PUBLIC_TMP=$tmp

For some reason I can deploy without any problems but when I navigate to the project, I instantly get a message that it cant see the environmental variables.
Has anyone had this problem before?
Solution:
no need for ENV just do ARG NEXT_PUBLIC_TMP assuming the variable next wants is NEXT_PUBLIC_TMP after all
Jump to solution
Ddouble_ducker8/24/2023
N/A
Solution
Bbrody1928/24/2023
no need for ENV just do ARG NEXT_PUBLIC_TMP assuming the variable next wants is NEXT_PUBLIC_TMP after all
Ddouble_ducker8/24/2023
Okay, I am going to give it a try
It works perfectly! Thanks
Bbrody1928/24/2023
awesome!

Looking for more? Join the community!

Recommended Posts
Railway CLI postgresql not installed?I installed the CLI and postgresql on my computer to use pgloader to migrate a mysql db to postgres How do I hook up my frontend correctly./I am able to deploy my backend but my frontend is not working yet. Error: ``` #8 [4/5] RUN npm ruStyling bug on project service usage pageIs there a way I can have Railway restart manually every 2 hours?Pretty self explanatory, I’m running some js codePostgres, Aspnet Core API and Angular WebguiHi guys. I'm new here and getting to know railway! I find it fantastic for us. I am lost. I would lCannot change default provider for environment thats created during GitHub Pull RequestI posted about this a while back (https://discord.com/channels/713503345364697088/112689969354953113expressidkI'm not sure on how to transfer my wiki.js database data to railway.86f37e49-db7c-4b6f-9c3e-71f5447b116a I am either getting a broken wiki.js database that results in Build and deployment is accountable in service consumptionconsider in a context of docker image number of images downloaded and each operation performed in doQuestion about billHello i have a railway acount and i work with my accounting team but they need an tax number identifEnvironment Variable Not foundI am using nodejs as a backend and the config plugin with it to get the access to the Railway envoirERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sockI tried deleting my Railway proc file and getting this error now ERROR: Cannot connect to the DockerNeed wordpress template helpI have this error: Please contact your hosting service and ask them to increase max_input_vars valueCan't login using my emailHi there, I'm trying to login to my account using the magic link, but whenever I do it I get this erDjango Deployment Issue - 503 Error on Railway PlatformHello, I am encountering a 503 error ("Application failed to respond") while deploying my Django apAccessing application results in 502. "upstream connect error or disconnect/reset before headers. "Trying to publish an application to the railway platform. It is a mixture of react, together with soAbout Private networkingHi, I saw Railway has https://docs.railway.app/reference/private-networking Private network domain, refundThe estimated bill is $5, but the actual cost is $11.99, which is much higher than expected. I reque