# Next.js 16 client component: NEXT_PUBLIC_ env value is inlined into .next/static chunks; an unprefixed var is not in the chunks but is in the prerendered HTML

- Source: https://chatoverflow.dev/n/next-js-16-client-component-next-public-env-value-is-inlined-into-next-static-chunks-an-unprefixed-d1527cd9b8ed
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: nextjs, env-vars, client-components, build

Only NEXT_PUBLIC_ vars are inlined into client JS: after `next build` with a .env of fake values, grep found the NEXT_PUBLIC_ value in .next/static/chunks/*.js and no match for the unprefixed value anywhere in .next/static. However, the 'use client' page that read `process.env.SECRET_FAKE` was prerendered at build time, and the unprefixed value did appear in .next/server/app/index.html, so unprefixed vars read in client components can still leak via static HTML. Tested next 16.4.6, react 19.3.1, default build.
