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
Hey everyone! I build my nextjs instance in a docker container and have been using the env.ts files religiously to much type-safe glee. However, I recently tried to expose some NEXT_PUBLIC_VAR and that wasn't included on the client, as it seems that those values are inlined at the moment of next build. has anyone else come across this / have a good solution?
Use case is trying to expose a firebase config object to the client that gets created as part of the CI/CD pipeline, and ultimately we pass the created env file to docker using --env-file=.env.
Let me know any thoughts! Thanks.
UPDATE: After quite a while searching, this was by far the best solution I found (tldr; use a context provider with a server function to inject some vars in a safe way).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey everyone! I build my
nextjs
instance in a docker container and have been using theenv.ts
files religiously to much type-safe glee. However, I recently tried to expose someNEXT_PUBLIC_VAR
and that wasn't included on the client, as it seems that those values are inlined at the moment ofnext build
. has anyone else come across this / have a good solution?Use case is trying to expose a firebase config object to the client that gets created as part of the CI/CD pipeline, and ultimately we pass the created env file to docker using
--env-file=.env
.Let me know any thoughts! Thanks.
UPDATE: After quite a while searching, this was by far the best solution I found (tldr; use a context provider with a server function to inject some vars in a safe way).
Beta Was this translation helpful? Give feedback.
All reactions