prisma7-custom-output

Installation
SKILL.md

Prisma 7 Custom Output Migration

Migrate a Prisma 7 project from the deprecated prisma-client-js generator (which outputs to node_modules/.prisma/client/) to the prisma-client generator with a custom output directory. This eliminates an entire class of monorepo bugs caused by stale nested node_modules copies.

Citations:

Why This Migration Matters

With prisma-client-js, the generated client lives in node_modules/.prisma/client/. In monorepos, this causes:

  1. Hoisting bugs — package managers may create nested node_modules/@prisma/client/ copies in workspace packages that declare @prisma/client as a dependency. prisma generate writes to root, but TypeScript resolves through the nested copy.
  2. Stale build caches — CI/CD (especially Vercel) caches node_modules between deploys. After schema changes or Prisma upgrades, the cached nested copies contain stale types.
  3. Phantom type errors — Property 'X' does not exist on type 'PrismaClient' when the model IS in the schema.

With prisma-client, the generated client lives in a directory controlled by the project (e.g., packages/db/src/generated/prisma/). No node_modules resolution games.

Installs
1
First Seen
Sep 15, 2026