17 days ago
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…
16 Replies
17 days ago
are you hitting the redeploy button after you set the env variable?
17 days ago
Just click to accept the variable change in the purple notification at the top of the site, and it is automatically implemented. Not enough?
17 days ago
yeah that's what i meant - is it still not being applied after you hit the purple notif?
17 days ago
Yes, my application has an error that the variable is not applied in the environment.
17 days ago
when you go to your service -> variables, do you see it there?
17 days ago
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.
17 days ago
Yes
17 days ago
Now I was able to deploy, but I had to remove the checks to see if the variable exists.
17 days ago
are you building it via railpack? im not sure what can cause that condition to fail tbh
17 days ago
Dockerfile
17 days ago
is your dockerfile trying to read them during the docker build or during run time?
17 days ago
build time becouse run nextjs build
17 days ago
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)
17 days ago
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.
17 days ago
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
17 days ago
for your specific use case, you might want to look at https://docs.railway.com/guides/dockerfiles#using-variables-at-build-time