NEXTjs 14 - ENV Variables aren't being recognized in production build
I've created succesfully a dockerfile and added all the env variables in the "variables" section of railway and deployed, my app is running, but, when i try to do some operations that require to read from the env, it gives an empty string, i thought that i might misspelled the variable name, but it's not the case, i'm not sure exactly what is going on
PSDT : it seems that it only happens for client side env variables, server side works fine
7 Replies
Project ID:
668ffc82-69a0-4dfa-8d2d-3fa3fd2d127c
project id 👉 668ffc82-69a0-4dfa-8d2d-3fa3fd2d127c
bet, i'll try and let you know if it works
So that means that i would have to declare every single env in my dockerfile ?¿
like ARG NEXT_PUBLIC_API ?¿
only the ones you need during build
yes sir, it solved the problem, thankss !!!
no problem!