You're seeing this error when trying to create a user:
The table `public.users` does not exist in the current database.
Prisma CLI only reads from .env, not .env.local:
cp .env.local .envThis creates the users table in Supabase:
pnpm prisma db pushYou should see:
✔ Generated Prisma Client
Database is now in sync with Prisma schema
Stop your dev server (Ctrl+C) and restart:
pnpm devNow try creating a user at http://localhost:3000/signup
- Next.js reads environment variables from
.env.local - Prisma CLI only reads from
.env - You need both files with the same content!
Open Prisma Studio to see your database:
pnpm prisma studioOpens at: http://localhost:5555
You should see the users table there.
Make sure .env has this format:
DATABASE_URL="postgresql://postgres.xxx:password@xxx.pooler.supabase.com:5432/postgres"pnpm prisma generate- Go to Supabase Dashboard
- Project Settings → Database
- Copy the "Connection string" (Pooler connection recommended)
- Replace
[YOUR-PASSWORD]with your actual password - Update
DATABASE_URLin both.envand.env.local
- Created
.env.localwith Supabase credentials - Copied
.env.localto.env - Ran
pnpm prisma db push - Verified table exists in Prisma Studio
- Restarted dev server
- Successfully created test user
After completing these steps, your authentication should work! 🚀