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:

相关推荐
独孤--蝴蝶21 分钟前
Docker容器进阶(一)
运维·docker·容器
he391237728 分钟前
ogg命令
运维·网络
其实防守也摸鱼30 分钟前
Kimi K3深度测评:长文本之外的真实力
运维·开发语言·网络·人工智能·python·学习·安全
imc.1131 分钟前
linux EXT文件系统
linux·运维·服务器
三言老师2 小时前
mv移动文件、重命名文件实战案例
linux·服务器·网络·centos
向夏威夷 梦断明暄2 小时前
C# 弃元模式:从语法糖到性能利器的深度解析
服务器·数据库·c#
乱世刀疤3 小时前
Claude Code提高工作效率案例:自动化分析工作流程时效性,缩短工单流转时长
运维·自动化
AOwhisky3 小时前
云原生 DevOps 工具链从入门到实战(第二期)——Jenkins安装与基础配置——CICD核心引擎
linux·运维·ci/cd·云原生·jenkins·devops
一叶之秋14123 小时前
Linux网络初识
linux·服务器·网络
盐焗鹌鹑蛋3 小时前
【Linux】基础开发工具yum和vim
linux·运维·vim