D
P
0
← All articles

Topic

Next.js & React in Production

`next dev` is green, `next build` fails; the page is 200 locally and 500 on Vercel. This cluster is about the gap between development and production in Next.js: undefined env variables, DYNAMIC_SERVER_USAGE from a nested server component, and Turbopack crashing on exactly one machine. For App Router developers whose bugs only appear after deploy.

25 articles

Start here

Next.js Environment Variable Undefined in Production? Here's Why

You set NEXT_PUBLIC_ in your hosting dashboard, but in production the value is undefined. The cause: these variables are baked at build time, not read at runtime. Here's how it works.

Read More