PrismaClientInitializationError: 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.
Within the scripts section of your project's package.json file, if there is not already a script named postinstall, add one and add prisma generate to that script:
{
...
"scripts" {
"postinstall": "prisma generate"
}
...
}
The application's build script in package.json
Within the scripts section of your project's package.json file, within the build script, prepend prisma generate to the default vercel build command:
{
...
"scripts" {
"build": "prisma generate && <actual-build-command>"
}
...
}
https://www.prisma.io/docs/guides/other/troubleshooting-orm/help-articles/vercel-caching-issue
Learn to configure your build process on Vercel to avoid caching-related problems
Learn to configure your build process on Vercel to avoid caching-related problems
www.prisma.io