← All fixes
Prisma on Vercel: outdated Prisma Client because Prisma's auto-generation isn't triggered
#129Error
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 yet0 worked0 didn't
Tried it yourself?
Related fixes
Prisma Client could not locate the Query Engine for runtime
#156PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". This happened because Prisma Client was generated for "windows", but the actual deployment required "rhel-openssl-3.0.x".
npm install fails with ERESOLVE unable to resolve dependency tree (peer dependency conflict)
#36npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree npm error Could not resolve dependency: peer react@"^18.3.1" from react-dom@18.3.1
Generated tsvector column fails: generation expression is not immutable
#14ERROR: generation expression is not immutable
postgresVerifiedNo reports yet