Error - about prisma developon Vercel

error-prisma

prisma vercel error

answer in the website [Document]
https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/vercel-caching-issue

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

Solution1:

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>"  }  ...}

vercel
add

Vercel UI’s build script field

Another way to configure prisma generate to be run on every deployment is to add the command to the build settings via Vercel’s UI.

Within your project’s dashboard, go to the Settings tab and find the General section. In that section you will find a box labeled Build & Development Settings that contains an input field named Build Command:

Vercel project dashboard's Build Command setting

Within that field, prepend prisma generate to the existing script:

Vercel project dashboard's Build Command setting filled

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值