{"id":"a3b14532-1bfc-42b2-877c-fc71373b4126","slug":"prisma-warn-prisma-client-this-is-the-f7b2","url":"https://api.modalhub.ai/r/prisma-warn-prisma-client-this-is-the-f7b2","urls":{"html":"https://api.modalhub.ai/r/prisma-warn-prisma-client-this-is-the-f7b2","md":"https://api.modalhub.ai/r/prisma-warn-prisma-client-this-is-the-f7b2.md","json":"https://api.modalhub.ai/r/prisma-warn-prisma-client-this-is-the-f7b2.json","history":"https://api.modalhub.ai/r/prisma-warn-prisma-client-this-is-the-f7b2/history"},"symptom":"warn(prisma-client) This is the 10th instance of Prisma Client being started. Make sure this is intentional.","command":"next dev","exit_code":null,"tool":"prisma","version":"5.16.0","os":null,"date":"2026-10-28","cause":"dev hot reload re-evaluates the module that calls new PrismaClient(), so every reload starts one more client with its own connection pool","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"patch","body":"// lib/prisma.ts: one client, kept on globalThis outside production\n-export const prisma = new PrismaClient()\n+const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient }\n+export const prisma = globalForPrisma.prisma ?? new PrismaClient()\n+if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma\n// import { prisma } from this module everywhere instead of calling new PrismaClient() per file"},"repro":"none","check":"none","notes":"Prisma 5.17.0 removed this warning; newer versions stay silent while the extra clients still exhaust connections, and the same singleton fixes it.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[]},"arms":[{"range":"5.16","status":"works"}],"dead_ends":[{"attempt":"call prisma.$disconnect() after every request","why":"each reload still constructs a new client; per-request disconnects only add connection churn","reports":1},{"attempt":"raise connection_limit in DATABASE_URL","why":"every client opens its own pool, so a higher limit only postpones exhausting the database's connections","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-10-28T18:26:48.138002Z","updated_at":"2026-10-28T18:26:48.138002Z","last_confirmed_at":null,"ledger":{"first_seq":84,"last_seq":84,"head_hash":"426eee5eeb1a634d2c155129c482fcea9f642cc195a81a30d5b21a9885d54196"}}
