Hello, I need urgent help. Since two days ago, my production app started failing to connect to the database after following the Neon + Prisma documentation.
I’m using Vercel with Prisma + Neon (serverless) and I’m getting the following error in production:
Cache function error: Error [NeonDbError]: Error connecting to database: TypeError: fetch failed cause: Error [SocketError]: other side closed code: 'UND_ERR_SOCKET' clientVersion: '7.0.0'
This is my current lib/prisma.ts configuration: import { PrismaClient } from '@/app/generated/prisma/client'; import { neonConfig } from '@neondatabase/serverless'; import { PrismaNeon } from '@prisma/adapter-neon'; import 'dotenv/config';
import ws from 'ws'; neonConfig.webSocketConstructor = ws; neonConfig.poolQueryViaFetch = true;