Prisma · type error

Property 'x' does not exist on type 'PrismaClient'

what it looks like
Type error: Property 'invoice' does not exist on type 'PrismaClient<PrismaClientOptions, never, DefaultArgs>'.

What it means

The model or field exists in schema.prisma but not in the generated client TypeScript sees. The client is generated code: it only changes when prisma generate runs.

Common causes

  • The agent added a model to schema.prisma and went straight to writing queries
  • The model name is singular in the schema (model Invoice) but the code uses db.invoices
  • The editor's TypeScript server still has the old types cached

How to fix it

  1. Run npx prisma generate (prisma db push and prisma migrate dev also run it)
  2. Use the lowercase model name: model Invoice becomes db.invoice
  3. Restart the TypeScript server in your editor if the error stays after generating

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

Prompt for Cursor or Claude Code

TypeScript says a model doesn't exist on PrismaClient. Check prisma/schema.prisma for the model and its exact name, run prisma generate (or prisma db push for local dev), and fix any code that uses a plural or misspelled model name. Don't cast db to any.

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