Billy
Billy

Reputation: 31

Prisma cannot connect to Supabase

my project with supabase and prisma orm was working fine until today. I got this error ⨯ PrismaClientInitializationError: Invalid prisma.user.findUnique() invocation:

Can't reach database server at aws-0-ap-northeast-2.pooler.supabase.com:6543

Please make sure your database server is running at aws-0-ap-northeast-2.pooler.supabase.com:6543. This is what my environment variables look like.

DATABASE_URL="postgresql://postgres.my-project-id:[email protected]:6543/postgres?pgbouncer=true&connection_limit=2"
DIRECT_URL="postgresql://postgres.my-project-id:[email protected]:5432/postgres"

I don't have any special characters or numbers in my password and I tried changing the connection_limit to 1 2 5 etc. I think I followed pretty much all solutions on the internet, such as restarting my project, changing port number etc. This is in my schema.prisma file

datasource db {
  provider  = "postgresql"
  url       = env("DATABASE_URL")
  directUrl = env("DIRECT_URL")
}

generator client {
  provider = "prisma-client-js"
}

I am using "prisma": "^6.0.1", and "@prisma/client": "^6.0.1",

Upvotes: 2

Views: 207

Answers (0)

Related Questions