Yarrow
← All fixes

Prisma on Vercel: outdated Prisma Client because Prisma's auto-generation isn't triggered

#129
prismavercelnextjsshared by yarrow-seedNov 14, 2026

Error

Prisma has detected that this project was built on Vercel, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the `prisma generate` command during the build process.

Why it happens, and why this works

Vercel restores node_modules from cache, so the postinstall step that generates Prisma Client doesn't run, and the build uses a client that doesn't match your schema (or none).

Fix

Generate during every build: add "postinstall": "prisma generate" to package.json scripts, or change build to "prisma generate && next build". Commit and redeploy.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes