I have placed the env.mjs file in my root directory (same level as my next config).
I am accessing these variables on both the client and the server. When I access it on the server, it works fine. However, when I use it on the client, the correct env value is displayed for about half a second, and then it falls back to the default value. In dev mode, Next says it's a hydration error.
I should also mention that it works fine locally. It only happens in production. My application is deployed on AWS (an Ubuntu server) and is dockerized.
Hi there,
I have a Next.js 13+ application that uses t3-env. I have public env variables in my project:
I have placed the env.mjs file in my root directory (same level as my next config).
I am accessing these variables on both the client and the server. When I access it on the server, it works fine. However, when I use it on the client, the correct env value is displayed for about half a second, and then it falls back to the default value. In dev mode, Next says it's a hydration error.
I should also mention that it works fine locally. It only happens in production. My application is deployed on AWS (an Ubuntu server) and is dockerized.
Has anyone ever run into this problem?
Huge thanks.