-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Getting MaxListenersExceededWarning on Neon adapter #28251
Copy link
Copy link
Closed
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.
Description
Bug description
Since upgrading to prisma@6.17.0, I’m getting this in vercel/next with Fluid Compute:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
at _addListener (.next/server/chunks/2774.js:8:3593)
at bF.addListener (.next/server/chunks/2774.js:8:6670)
at bI._release (.next/server/chunks/2774.js:13:32360)
at bF.release (.next/server/chunks/2774.js:13:32316)
at cI.commit (.next/server/chunks/2774.js:33:12299) {
emitter: [NeonClient],
type: 'error',
count: 11
}
I can see this might be related to similar issues like #28037
This is how I instantiate Prisma:
import { PrismaNeon } from '@prisma/adapter-neon'
import { PrismaClient } from '@prisma/client'
const prismaClientSingleton = () => {
const connectionString = `${process.env.DATABASE_URL}`
const adapter = new PrismaNeon({
connectionString,
})
return new PrismaClient({
adapter,
transactionOptions: {
timeout: 15000,
},
})
}
const globalForPrisma = globalThis as {
prisma?: ReturnType<typeof prismaClientSingleton>
}
export const prisma = globalForPrisma.prisma ?? prismaClientSingleton()
if (!globalForPrisma.prisma) {
globalForPrisma.prisma = prisma
}Package versions
"@prisma/adapter-neon": "^6.17.0",
"@prisma/client": "6.17.0",
"prisma": "6.17.0",
Severity
🔹 Minor: Unexpected behavior, but does not block development
Reproduction
Just install it with the versions and deploy to Vercel with more requests.
Expected vs. Actual Behavior
Just constant warnings.
Frequency
Consistently reproducible
Does this occur in development or production?
Only in production (e.g., query engine, generated client)
Is this a regression?
Yes, last worked in Prisma 6.14.0, broke later
Workaround
Downgrading to Prisma 6.14.0 fixes it
Prisma Schema & Queries
Any.
Prisma Config
Logs & Debug Info
// Debug logs here
Environment & Setup
Vercel node v20
Prisma Version
6.17.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.