Vercel throwing error while deploying
Unanswered
Dwarf Crocodile posted this in #help-forum
Dwarf CrocodileOP
My project uses Next, nextAuth (google), NeonDB (free tier) and Prisma.
When i deploy it (using github), i get this in build logs:
When i deploy it (using github), i get this in build logs:
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.
at t (/vercel/path0/.next/server/app/api/auth/[...nextauth]/route.js:1:2204)
at /vercel/path0/.next/server/app/api/auth/[...nextauth]/route.js:1:2235 {
clientVersion: '6.4.1',
errorCode: undefined
> Build error occurred
Error: Failed to collect page data for /api/auth/[...nextauth]
at /vercel/path0/node_modules/next/dist/build/utils.js:1268:15
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
type: 'Error'
}
Error: Command "npm run build" exited with 1
3 Replies
// package.json
{
...
"scripts" {
"postinstall": "prisma generate"
}
...
}
Dwarf CrocodileOP
thnx