Vercel Build Dependency Caching Workaround | Vercel Cache Prisma Error
Stumbled across this 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. Learn how: https://pris.ly/d/vercel-build
Update your package.json
It can be fixed by overriding the build
script in your package.json
.
{ ... "scripts" { "build": "prisma generate && <actual-build-command>" } ... }
Override your build settings in Vercel
You can also update it straight from the Vercel UI.
Go to your project settings and override the build settings to run prisma generate && <actual-build-command>
or if it's a Next.js project here's the full example:
npx prisma generate && next build
Follow me on Twitter or connect on LinkedIn.
🚨 Want to make friends and learn from peers? You can join our free web developer community here. 🎉