You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How are you deploying your application? (if relevant)
Docker Image with Standalone
Describe the Bug
Environment Variables set at Runtime don't work on the client, only on the server, even when prefixed with NEXT_PUBLIC_.
This also happens with a loaded.env file
Expected Behavior
Environment Variables with the NEXT_PUBLIC_ prefix are useable in the browser
To Reproduce
make a docker image with the standalone version
run the image with a environment variable NEXT_PUBLIC_TESTVAR supplied via docker env vars
try to access the variable in a page with process.env.NEXT_PUBLIC_TESTVAR - it'll return undefined
The text was updated successfully, but these errors were encountered:
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.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Docker Image with Standalone
Describe the Bug
Environment Variables set at Runtime don't work on the client, only on the server, even when prefixed with
NEXT_PUBLIC_
.This also happens with a loaded
.env
fileExpected Behavior
Environment Variables with the
NEXT_PUBLIC_
prefix are useable in the browserTo Reproduce
NEXT_PUBLIC_TESTVAR
supplied via docker env varsprocess.env.NEXT_PUBLIC_TESTVAR
- it'll returnundefined
The text was updated successfully, but these errors were encountered: