Narendra Sharma
Narendra Sharma

Reputation: 319

How to fix the Invalid environment variables error in T3 Stack

I have downloaded the repo from Github and trying to run in my local machine. Installed cross-env package.

----------- Error -----------------

ERROR (console/15295 on Narendras-MacBook-Air.local): ❌ Invalid environment variables: DATABASE_URL: Required NEXTAUTH_SECRET: Required NEXTAUTH_URL: Required AUTH0_CLIENT_ID: Required AUTH0_CLIENT_SECRET: Required AUTH0_ISSUER: Required

Upvotes: 5

Views: 9883

Answers (1)

Lawrence Chen
Lawrence Chen

Reputation: 21

You don't need to install cross-env as Next.js automatically exposes environment variables to your server.

Make sure you have a .env file in your project's root:

DATABASE_URL=
NEXTAUTH_SECRET=
NEXTAUTH_URL=
AUTH0_CLIENT_ID=
AUTH0_CLIENT_SECRET=
AUTH0_ISSUER=

Upvotes: 0

Related Questions