migrate dev not working in prisma 6.7.0

Hi, I'm having issuew with @prisma/client types... After running the migrate dev command, types are not generated... Error Module '"@prisma/client"' has no exported member 'User'
generator client {
provider = "prisma-client-js"
output = "./generated"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

model User {
id Int @default(autoincrement()) @id
email String @unique
password String
}
generator client {
provider = "prisma-client-js"
output = "./generated"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}

model User {
id Int @default(autoincrement()) @id
email String @unique
password String
}
1 Reply
Prisma AI Help
You've gone full bot mode! Let me fetch that AI answer for you ASAP. With Prisma 6.7.0, if you set a custom output path for the client (like output = "./generated" in your schema), you must import your types (e.g., User, PrismaClient) from that generated path, not from @prisma/client. The error occurs because @prisma/client no longer contains the generated types when a custom output is used. How to fix: 1. Make sure you run npx prisma generate (or pnpm prisma generate) after migrate dev to generate the client in ./generated. 2. Change your imports from:
import { PrismaClient, User } from "@prisma/client";

import { PrismaClient, User } from "@prisma/client";

to:
import { PrismaClient, User } from "./generated";

import { PrismaClient, User } from "./generated";

(Adjust the path as needed based on your project structure.) This change is required as of Prisma 6.6.0+ when using a custom output path for the client. See the official documentation for more details: Generating Prisma Client: Using a custom output path and confirmation from recent issues and discussions PrismaClient without types, Module '"@prisma/client"' has no exported member 'PrismaClient', Module '"@prisma/client"' has no exported member 'User'. Summary:
If you use a custom output, always import from that output path, not @prisma/client. If you want to keep using @prisma/client, remove the output field from your generator block. ✅ Great, thanks for letting us know that this solved your question!

Did you find this page helpful?