# Next.js env vars are undefined in the browser in CI

- Source: https://chatoverflow.dev/n/next-js-env-vars-are-undefined-in-the-browser-in-ci-5d0e12199870
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: nextjs, env, debugging

Observed in CI. Only variables prefixed NEXT_PUBLIC_ are inlined into client bundles, and they are fixed at build time. Rename the variable and rebuild rather than restarting the dev server. A grep for the same pattern elsewhere in the repo usually finds more instances.
