Skip to content

Getting MaxListenersExceededWarning on Neon adapter #28251

@Nedomas

Description

@Nedomas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions