#⚠️ Prisma 7.4.2 + Next.js 16.1.6: Module not found '@prisma/client-runtime-utils'

3 messages · Page 1 of 1 (latest)

pastel geode
#

Environment:

Framework: Next.js 16.1.6 (Turbopack enabled)

ORM: Prisma 7.4.2

Auth: better-auth 1.4.20

Runtime: Node v25.6.1

Package Manager: pnpm v10.0.0

The Issue:
Running next build fails with:
Module not found: Can't resolve '@prisma/client-runtime-utils'

Context:
I'm using the new Prisma 7 configuration (with prisma.config.ts). Since better-auth 1.4.20 has strict peer dependencies, I suspect there might be a hoisting issue with pnpm 10 or a conflict with the new @prisma/client-runtime-utils package not being bundled correctly by Next.js 16.

What I've tried:

pnpm install @prisma/[email protected] [email protected] to ensure version parity.

pnpm exec prisma generate.

Deleting .next and node_modules and re-running pnpm i.

Questions:

Is anyone else seeing @prisma/client-runtime-utils resolution errors specifically with pnpm 10?

Do I need to add @prisma/client-runtime-utils to serverExternalPackages in next.config.ts for Next 16?

Has anyone successfully bypassed the better-auth peer dependency conflict with Prisma 7 using pnpm 10's overrides or readPackage hook?

white loomBOT
#

Skipping coffee for instant knowledge! Let's brew that AI answer now.

white loomBOT
# white loom Skipping coffee for instant knowledge! Let's brew that AI answer now.

This is a known issue with Prisma 7 and pnpm's package isolation. The most widely confirmed fix is to explicitly install @prisma/client-runtime-utils as a direct dependency in the package where your Prisma client is used:

pnpm install @prisma/client-runtime-utils

With pnpm, dependencies are isolated and symlinked, so the generated client cannot resolve the runtime-utils package unless it exists as a top-level dependency. [pnpm isolation fix]

Other Workarounds

1. Hoist the package via .npmrc:

public-hoist-pattern[]=@prisma/client-runtime-utils

[npmrc hoisting]

2. For Next.js + Turbopack specifically, one user resolved a similar module-not-found error by adding to next.config:

transpilePackages: ['@prisma/client', '@prisma/adapter-pg', 'pg'],

[Turbopack fix]

3. Disable TypeScript declaration generation (workaround only):

{ "declaration": false }

4. Downgrade to Prisma 6.x if none of the above work, as the issue is specific to Prisma 7's new architecture. [downgrade option]

Regarding your specific questions:

  • The @prisma/client-runtime-utils resolution error with pnpm 10 is confirmed by multiple users — installing it explicitly is the primary fix.
  • The knowledge sources don't explicitly mention serverExternalPackages as a solution, nor do they address the better-auth peer dependency conflict specifically.