Error
⨯ TypeError: Cannot read properties of undefined (reading '__internal')
at prismaClientSingleton (webpack-internal:///(rsc)/./src/lib/prisma.ts:9:12)
at eval (webpack-internal:///(rsc)/./src/lib/prisma.ts:11:43)
at <unknown> (rsc)/./src/lib/prisma.ts (/Users/nicolaeser/Documents/Development/PROVID/website/.next/dev/server/app/[locale]/(app)/app/page.js:239:1)
at eval (webpack-internal:///(rsc)/./src/lib/auth.ts:11:69)
at <unknown> (rsc)/./src/lib/auth.ts (/Users/nicolaeser/Documents/Development/PROVID/website/.next/dev/server/app/[locale]/(app)/app/page.js:228:1)
at eval (webpack-internal:///(rsc)/./src/app/[locale]/(app)/layout.tsx:9:67)
at <unknown> (rsc)/./src/app/[locale]/(app)/layout.tsx (/Users/nicolaeser/Documents/Development/PROVID/website/.next/dev/server/app/[locale]/(app)/app/page.js:151:1) {
type: 'TypeError',
page: '/de/app'
}
2 Replies
You selected the bot's instantaneous insights. Let me compile your answer right away!
That
With the default (Rust‑free) engine,
Some users in pure ESM / NestJS resolved this specific
TypeError: Cannot read properties of undefined (reading '__internal') happens when Prisma Client v7 is instantiated in a way that doesn’t match its new requirements, especially in ESM / Next.js setups. [Prisma 7 ESM bug]
From the linked issue and comments:
1. Prisma 7 requires an adapter (Rust‑free client)With the default (Rust‑free) engine,
new PrismaClient() without options is no longer valid – you must pass either a driver adapter or accelerateUrl. [Prisma 7 breaking changes; constructor change]
Example for PostgreSQL with @prisma/adapter-pg (pattern only, adapt paths/env to your app):
2. If you’re using the singleton pattern, the inner call must pass the adapter too:
3. ESM/CJS workaround (optional)Some users in pure ESM / NestJS resolved this specific
__internal crash by forcing the client to generate as CommonJS:
Then run npx prisma generate. [ESM workaround]
If you’ve already added an adapter and still see __internal, that may be the Prisma 7 bug mentioned in the issue; in that case, the moduleFormat = "cjs" workaround is the documented fix in the sources. [ESM work
around]how to keep it generated in @prisma/client