General
Troubleshooting

Database

Learn about database troubles and their solutions.

I'm using Supabase and the application is slow in production

Make sure your application and database are physically close. If you use Vercel and Supabase make sure they are in the same AWS region. For example

  • Vercel (D.C.) and Supabase (Virginia): Both are in us-east-1 - the application is fast.
  • Vercel (D.C.) and Supabase (Ohio): You are dealing with two different AWS regions, the app is up to x12 slower!

Database connection errors

If you're seeing connection errors:

  1. Check that your DATABASE_URL is correctly set in .env
  2. Verify your database is running and accessible
  3. Check that your database credentials are correct
  4. Ensure your IP is whitelisted if using a managed database service

Prisma migration errors

If Prisma migrations fail:

  1. Make sure your database is accessible
  2. Check that you have the correct permissions
  3. Review your Prisma schema for any errors
  4. Try running migrations (which automatically generates the Prisma client): npm run db:migrate:dev

Prisma client not found

If you see "Prisma Client not found" errors:

  1. Run npm run db:migrate:dev to generate the Prisma client and apply migrations
  2. Make sure prisma/schema.prisma exists and is valid
  3. Restart your development server after generating the client