#"PrismaClient" is not exported by "generated/client",
3 messages · Page 1 of 1 (latest)
This usually happens when:
- You use a custom
outputfor the client, and - You still import from
@prisma/clientor from a path that doesn’t match what Prisma actually generates.
With a custom output like:
generator client {
provider = "prisma-client-js"
output = "../../src/generated/client"
}
Prisma will generate a module at src/generated/client that you must import from directly, e.g.:
// packages/database/src/client.ts
import { PrismaClient } from '../generated/client';
const prisma = new PrismaClient();
export { prisma };
This is the same pattern used in Prisma’s Turborepo guide, where the client is generated to ../generated/prisma and then imported from that path instead of @prisma/client.[Turborepo guide]
Also, since Prisma 6.6+ you must align your imports with the custom output path; if you keep importing from the old location, TypeScript (or your bundler) will correctly say PrismaClient is not exported.[Issue 13672 comment]
If you still see the error:
- Run
npx prisma generatein thedatabasepackage. - Confirm that
src/generated/client/index.d.ts(and.js) actually exportPrismaClient. - Make sure your import path in
client.tsis exactly the relative path to that generated folder.
🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.