Error: Cannot find module '.prisma/client/default' on startup (Prisma 7, custom output path)

On app startup, Node crashes with Error: Cannot find module '.prisma/client/default' (require stack points at nodemodules/@prisma/client/default.js) before any database connection is attempted. The setup used provider = "prisma-client" with a custom output path (output = "../src/generated/prisma") in the generator block. The .prisma folder never appears in nodemodules because the custom output redirects generation elsewhere.

Remove the custom output line from your generator block (or leave the default), then re-run npx prisma generate. The .prisma folder only gets written into node_modules when the client is generated without a custom output path; with output pointed elsewhere, the default entry at @prisma/client/default.js has nothing to require. The reporter closed the issue after confirming this: deleting the output line and re-running prisma generate fixed startup. One more commenter fixed the same crash by switching the provider to "prisma-client-js" with moduleFormat = "cjs" and regenerating. Source: https://github.com/prisma/prisma/issues/29075