#Updated to prisma v7 and now getting errors
7 messages · Page 1 of 1 (latest)
You opted for speed from this bot. Let's conjure up an answer right now!
This error usually means your generated Prisma Client doesn’t match what @prisma/client v7 expects (path runtime/library.js no longer exists or isn’t exported).
From similar reports, there are two common fixes you can try:
- Regenerate the client to a dedicated output folder and import from there
In your schema.prisma:
generator client {
provider = "prisma-client-js"
output = "../node_modules/.prisma/client"
}
Then:
pnpm prisma generate # or npm/yarn equivalent
And update your imports:
import { PrismaClient } from '../node_modules/.prisma/client';
This pattern resolved runtime/library.js / ultron path errors for others after upgrading. [runtime subpath fix; ultron error]
- Ensure both packages are on v7 and fully reinstalled
Upgrade and reinstall cleanly:
# with pnpm
pnpm upgrade prisma@7 @prisma/client@7
rm -rf node_modules .pnpm-lock.yaml
pnpm install
pnpm prisma generate
The docs explicitly say you must upgrade both prisma and @prisma/client to v7 together. [Upgrade to v7]
If you still see Vite SSR resolution issues after that, they’re likely build‑tool related (similar to earlier Vite/Prisma interop problems), but the knowledge I have only documents the runtime/library.js path fixes above, not a Vite‑specific v7 change.
🤔 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.
How are you importing the PrismaClient?
Can you share the prisma.config.ts file and the generator block of your schema.prisma file?
I don't even have prisma.config.ts file
In schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
And is there any optimization for Mongodb in the latest version?
I'm using vite, so I've vite.config.ts file, and there is nothing inside this file which is related to prisma. 🤔