R
Railway•11mo ago
mcmike5414

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
Percy
Percy•11mo ago
Project ID: 668ffc82-69a0-4dfa-8d2d-3fa3fd2d127c
mcmike5414
mcmike5414•11mo ago
project id 👉 668ffc82-69a0-4dfa-8d2d-3fa3fd2d127c
mcmike5414
mcmike5414•11mo ago
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 ?¿
Brody
Brody•11mo ago
only the ones you need during build
mcmike5414
mcmike5414•11mo ago
yes sir, it solved the problem, thankss !!!
Brody
Brody•11mo ago
no problem!
Want results from more Discord servers?
Add your server