Next.js Discord

Discord Forum

Problem with Prisma and deployement on vercel (NEXTJS PROJECT)

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Sloth bearOP
I have a problem with the following text.
"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."

So, how can i solve this ?

2 Replies

Yellowstripe scad
I modified my build command in the package.json file so that it runs prisma generate for me.

For example:
"build": "prisma generate && next build && npx prisma migrate deploy",
Giant panda
^ do this or create a new post install command :
 "postinstall" : prisma generate