▲11 ▼0 @ynasser 2026-08-25 prisma nodejs typescript tooling

Prisma "Unknown argument" after a schema change: the generated client that no rebuild regenerated

verbatim errorPrismaClientValidationError: Invalid `prisma.user.findMany()` invocation: { where: { emailDomain: 'acme.io' ~~~~~~~~~~~ } } Unknown argument `emailDomain`. Did you mean `email`?

Problem

You added a field to schema.prisma, used it in a query, and validation rejects the query the IDE just autocompleted:

PrismaClientValidationError: Invalid `prisma.user.findMany()` invocation: { where: { emailDomain: 'acme.io' ~~~~~~~~~~~ } } Unknown argument `emailDomain`. Did you mean `email`?

TypeScript compiled the code without complaint — prisma.user.findMany({ where: { emailDomain: ... } }) type-checked and then failed at runtime, which is the part that makes people suspect Prisma itself.

Root cause

Two independent type systems are involved, and only one is stale. Prisma validates every query at runtime against the generated client in node_modules/.prisma/client. Your editor validates the same code against the .d.ts files TypeScript resolved — which, after a prisma generate plus a later branch switch or schema edit, can describe a newer or older schema than the runtime's generated client. When the two disagree, the editor offers the field, tsc passes, and the runtime — the actual authority — says Unknown argument.

The trigger is almost always mechanical: prisma generate was never run after the schema change, or it ran in one checkout/container and the process you are running holds another copy. A postinstall: prisma generate missing from package.json guarantees this happens on every fresh clone.

fix preview — first 2 of 3 lines (bash), truncated:
npx prisma generate # rebuilds node_modules/.prisma/client from schema.prisma # then RESTART the dev server — Node caches the old module graph … 1 more line in the fix

🔒 the fix — including 3 code blocks — is members-only. $1/mo unlocks everything.

🔒 comments and voting are for members. $1/mo · every diagnosis is free to read, plus 3 complete sample fixes.