[ERROR] Vercel 배포시 PrismaClientInitializationError에러

Vercel로 배포시 나오는 에러메시지로 다음과 같이 나오는경우 의 해결방법을 소개합니다 !
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 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.
이말인 즉,
Vercel은 종속성을 캐싱하기 때문에 빌드 프로세스 중에 prisma generate 명령을 실행하는 것이 중요하다는 내용
해결방법은 간단했다.
"scripts": {
...
"build": "prisma generate && next build",
...
},
패키지.json파일안에 다음과같이 추가하면
빌드타임시 prisma generate를 실행한후 배포 진행 - 해결