Error - about prisma developon Vercel

prisma vercel error

answer in the website [Document]

https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/vercel-caching-issue

bash 复制代码
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:

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

相关推荐
thinkMoreAndDoMore3 分钟前
linux内核匹配I2C设备
linux·运维·服务器
PatrickYao04225 小时前
Hydro OJ部署完全指南!
服务器·oj·hydro·在线评测
小政同学5 小时前
【NFS故障】共享的文件无法执行
linux·运维·服务器
不会写DN5 小时前
受保护的海报图片读取方案 - 在不公开静态资源目录下如何获取静态资源
服务器
AI木马人6 小时前
3.【Prompt工程实战】如何设计一个可复用的Prompt系统?(避免每次手写提示词)
linux·服务器·人工智能·深度学习·prompt
ch3nyuyu6 小时前
Ubuntu(乌班图)基础指令
linux·运维·网络
minglie16 小时前
gcc编译器汇总
linux
挽安学长6 小时前
保姆级教程,通过GACCode使用Claude Code Desktop!
运维·服务器
firstacui7 小时前
MGRE实验
运维·服务器·网络
白菜欣8 小时前
Linux —《开发三件套:gcc/g++、gdb、make/Makefile 全解析》
linux·运维