The pnpm workspaces guide (https://www.prisma.io/docs/guides/deployment/pnpm-workspaces) shows this import in client.ts and index.ts:
import { PrismaClient } from "./generated/client";
This works in Prisma 6 (prisma-client-js), where the generator creates an index.d.ts + index.js barrel in the output directory.
In Prisma 7 with the new prisma-client provider, the generator only outputs TypeScript source files (.ts) without a barrel index.ts (see issue #29525 (prisma/prisma#29525)). The output structure is:
generated/client/
├── client.ts ← PrismaClient lives here
├── models.ts
├── enums.ts
├── commonInputTypes.ts
├── internal/
└── models/
Since there is no index.ts or index.d.ts at generated/client/, the import "./generated/client" fails with Cannot find module './generated/client' or its corresponding type declarations.
The correct import when using Prisma 7 is:
import { PrismaClient } from "./generated/client/client";
Or alternatively, the guide should recommend wrapping exports through a barrel file in the database package (e.g., index.ts) to hide this implementation detail from consumers.
Suggested fix: update the guide to either:
- Change the import paths to "./generated/client/client", or
- Add a note explaining that Prisma 7 requires this path, and suggest using a barrel re-export for external consumers.
The pnpm workspaces guide (https://www.prisma.io/docs/guides/deployment/pnpm-workspaces) shows this import in client.ts and index.ts:
import { PrismaClient } from "./generated/client";This works in Prisma 6 (prisma-client-js), where the generator creates an index.d.ts + index.js barrel in the output directory.
In Prisma 7 with the new prisma-client provider, the generator only outputs TypeScript source files (.ts) without a barrel index.ts (see issue #29525 (prisma/prisma#29525)). The output structure is:
generated/client/
├── client.ts ← PrismaClient lives here
├── models.ts
├── enums.ts
├── commonInputTypes.ts
├── internal/
└── models/
Since there is no index.ts or index.d.ts at generated/client/, the import "./generated/client" fails with Cannot find module './generated/client' or its corresponding type declarations.
The correct import when using Prisma 7 is:
import { PrismaClient } from "./generated/client/client";Or alternatively, the guide should recommend wrapping exports through a barrel file in the database package (e.g., index.ts) to hide this implementation detail from consumers.
Suggested fix: update the guide to either: