Unverified Commit d49c4742 authored by Daniel Stumme's avatar Daniel Stumme Committed by GitHub

Adding small note to ENV documentation (#20860)

This single sentence addition would have saved me about a day of troubleshooting. This doc doesn't mention how the inline occurs. The only place I could eventually find that mentions this is the server & public runtime config pages.
parent 77a2eeb1
...@@ -81,7 +81,7 @@ In order to expose a variable to the browser you have to prefix the variable wit ...@@ -81,7 +81,7 @@ In order to expose a variable to the browser you have to prefix the variable wit
NEXT_PUBLIC_ANALYTICS_ID=abcdefghijk NEXT_PUBLIC_ANALYTICS_ID=abcdefghijk
``` ```
This loads `process.env.NEXT_PUBLIC_ANALYTICS_ID` into the Node.js environment automatically, allowing you to use it anywhere in your code. The value will be inlined into JavaScript sent to the browser because of the `NEXT_PUBLIC_` prefix. This loads `process.env.NEXT_PUBLIC_ANALYTICS_ID` into the Node.js environment automatically, allowing you to use it anywhere in your code. The value will be inlined into JavaScript sent to the browser because of the `NEXT_PUBLIC_` prefix. This inlining occurs at build time, so your various `NEXT_PUBLIC_` envs need to be set when the project is built.
```js ```js
// pages/index.js // pages/index.js
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment