Next.js Discord

Discord Forum

1Password Environments

Unanswered
German Wirehaired Pointer posted this in #help-forum
Open in Discord
German Wirehaired PointerOP
Hey there, I was trying to implement the 1Password environments to have centralized secrets and we're using t3-env for env vars validation in build-time but it is not loading the .env file and we're getting errors about missing variables (it works with a regular .env file), it worked in other services that we were using with docker.

We're using next@14.2.16 btw. any ideas of why is this happening? haven't try to upgrade the next version but it's like our last resource. or probably its a 1Password issue (?) at the end of the day, it's a beta still.

1 Reply

Western paper wasp
t3-env validates variables at build time, while 1Password Environments injects them at runtime. As a result, during the build step the variables aren’t available yet, and validation fails.
Solution: either disable build-time validation (switch to runtime), or provide the variables at build time (for example via .env/CI), or avoid using t3-env in this setup