ReferenceError: exports is not defined in ES module scope with provider = "prisma-client"

When switching the generator provider from "prisma-client-js" to the new "prisma-client" in a CommonJS project (moduleResolution: "nodenext"), the generated client crashes at startup: Object.defineProperty(exports, "__esModule", { value: true }) throws ReferenceError: exports is not defined in ES module scope. The generator emits ESM output by default, which breaks under a CommonJS runtime even though the project itself is not ESM.

Add moduleFormat = "cjs" to your generator block:

generator client { provider = "prisma-client" output = "./client" moduleFormat = "cjs" }

Then delete the old generated output and re-run prisma generate. The reporter and several later commenters confirmed this fixes the crash immediately. The generator defaults to ESM output, so any CommonJS project using the new "prisma-client" provider needs this line. Source: https://github.com/prisma/prisma/issues/27556