Skip to content

[docs] pnpm workspaces guide: import path ./generated/client doesn't work with Prisma 7 #7944

Description

@fco-gt

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:

  1. Change the import paths to "./generated/client/client", or
  2. Add a note explaining that Prisma 7 requires this path, and suggest using a barrel re-export for external consumers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions