Setting up public env vars in t3 app
I am following the docs (https://create.t3.gg/en/usage/env-variables) for setting up env vars in a t3 app. I have successfully added server env vars but I am having trouble adding client env vars. I am getting the following error
Invalid environment variables: { NEXT_PUBLIC_NEXTAUTH_URL: ["Required"] }
even though I have this var set up. If I log the env
object it seems to be there.
Here are my client
and runtimeEnv
objects in my env.mjs
file:
And here is NEXTAUTH_URL
in my .env
file:
NEXTAUTH_URL="http://localhost:3000"
Any ideas what I am doing wrong?Create T3 App
Environment Variables 🚀 Create T3 App
The best way to start a full-stack, typesafe Next.js app.
2 Replies