Next.js variables behave differently on the server and browser. Private variables stay server-side, while browser variables require NEXT_PUBLIC_ and a redeploy.
Platform: Next.js + Vercel
Error: Environment variables are missing on Vercel
Next.js variables behave differently on the server and browser. Private variables stay server-side, while browser variables require NEXT_PUBLIC_ and a redeploy.
# Server-only secret DATABASE_URL=postgres://... # Browser-visible value NEXT_PUBLIC_APP_URL=https://example.com
Do not expose database URLs, payment secrets, or private API keys with NEXT_PUBLIC_.
Send the deploy log, repository link, target platform, and expected URL. ShipFast Deploy Rescue is a fixed-price debugging service for indie projects and MVPs.