Prisma · runtime error

@prisma/client did not initialize yet

what it looks like
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

  1. Run npx prisma generate once locally
  2. Add "postinstall": "prisma generate" to package.json so every install regenerates
  3. Make the build script prisma generate && next build
package.json
"scripts": {
  "build": "prisma generate && next build",
  "postinstall": "prisma generate"
}

works with Prisma ORM 6.19 · Next.js 16last verified

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

$ 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.

Subscribe free