I can't pass env variables at runtime for next.js app router. #74130
Replies: 1 comment 1 reply
-
Yeah, NEXT_PUBLIC_ prefixed env vars are inlined at build time...
Maybe do that, or give this a try: https://www.npmjs.com/package/next-runtime-env |
Beta Was this translation helpful? Give feedback.
-
I am trying to containerize my next.js app to deploy to the docker hub.
I managed to build a docker image and push it to the docker hub but I can't pass the custom env file at runtime.
I think it is really tricky to pass client-side env variables at runtime.
I already researched previous approaches but couldn't find the solution for the latest next.js version.
I have over 20 client-side env variables.
next.js version: ^14.2.8
node package manager: npm
Beta Was this translation helpful? Give feedback.
All reactions