Problems with environment variables

Whenever I define an environment variable and confirm the change, the variable in the project says it is not defined, but in Vercel it works correctly…

$20 Bounty

16 Replies

are you hitting the redeploy button after you set the env variable?


Just click to accept the variable change in the purple notification at the top of the site, and it is automatically implemented. Not enough?


yeah that's what i meant - is it still not being applied after you hit the purple notif?


Yes, my application has an error that the variable is not applied in the environment.


when you go to your service -> variables, do you see it there?


I had to remove the variable checks, because before I changed it, it was like this: It checked if it existed and was filled in, and if not, it triggered an error. And it always triggered the error.


Yes


Now I was able to deploy, but I had to remove the checks to see if the variable exists.


are you building it via railpack? im not sure what can cause that condition to fail tbh


Dockerfile


is your dockerfile trying to read them during the docker build or during run time?


build time becouse run nextjs build


I think that may be the cause, I can do some testing once im back at my pc (railpack might deal with it better since its build time)


But why do I have to use Railpack? Will I need to use it for all apps that I upload to your infrastructure? I want to use dockerfile, which is already configured by default in my projects.


im just a person helping, not an employee.
https://docs.docker.com/build/building/variables/

youre trying to build args during build time using env variables which i do not believe would work. youd have to define them as args during build time.

railpack is developed by railway, https://docs.railway.com/reference/variables and so it allows env vars during build time



Loading...