Prisma · runtime error
@prisma/client did not initialize yet
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.What it means
@prisma/client is only a shell until prisma generate writes the real client for your schema. The code imported it before that ever happened on this machine or in this build.
Common causes
- The agent ran npm install prisma @prisma/client but never prisma generate
- A fresh clone or CI build where nothing runs prisma generate
- node_modules was cached from a build that had no schema yet
How to fix it
- Run npx prisma generate once locally
- Add "postinstall": "prisma generate" to package.json so every install regenerates
- Make the build script prisma generate && next build
"scripts": {
"build": "prisma generate && next build",
"postinstall": "prisma generate"
}Prompt for Cursor or Claude Code
Prisma says @prisma/client did not initialize yet. Run prisma generate, then make it permanent: add "postinstall": "prisma generate" and change the build script to "prisma generate && next build" in package.json. Don't change the schema.Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Prisma error fixer.
next: skip the next one
Skip the debugging. The VibeBoot SaaS Starter ships with this already handled: one Prisma client in src/lib/db.ts, prisma generate on every build and install, and AGENTS.md rules that tell your agent never to create another client. Plus auth and Stripe on Next.js 16.4.3. $49, one-time.
14-day money-back guarantee · lifetime updates
Other Prisma errors
- Property 'x' does not exist on type 'PrismaClient'
- Prisma has detected that this project was built on Vercel
- PrismaClient is unable to run in this browser environment
- PrismaClient is not configured to run in Edge Runtime
- Environment variable not found: DATABASE_URL
- The URL must start with the protocol postgresql://
$ fixed it? get the next one first
New fixes for what AI agents break, by email.
When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.