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
10 replies
Deploying nextjs 14 using Dockerfile crashes when "yarn build"
I have a nextjs14 app, and i'm deploying it using Dockerfile, i've dome multiple steps, i added the "standalone" option in next.config.js, i've installed sharp (since is required for image optimization), and i added Dockerfile from the docs (and changed some things for improvement). After all of this, i ran the docker build succesfully in my machine, and i was ready to deploy it to railway, but crashed with following error
16 | >>> RUN yarn build
❌ ERROR: failed to solve: process "/bin/sh -c yarn build" did not complete successfully: exit code: 1
how to solve 🥲
project id 👉 668ffc82-69a0-4dfa-8d2d-3fa3fd2d127c
14 replies