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:

相关推荐
舒克起飞了12 分钟前
linux系统编程——Makefile、GDB调试
linux·运维·服务器
背影疾风20 分钟前
C++之路:类基础、构造析构、拷贝构造函数
linux·开发语言·c++
deming_su28 分钟前
轻松上手:使用Nginx实现高效负载均衡
运维·nginx·负载均衡
m0_694845572 小时前
服务器如何配置防火墙规则开放/关闭端口?
linux·服务器·安全·云计算
降世神童2 小时前
华为云Flexus+DeepSeek征文| 使用华为云CCE容器部署Dify-LLM高可用方案的验证与测试
运维·华为云·aigc
降世神童2 小时前
华为云Flexus+DeepSeek征文| 基于华为云Dify-LLM高可用平台开发运维故障处理智能体
运维·华为云·aigc
阿巴~阿巴~2 小时前
Linux基本命令篇 —— alias命令
linux·服务器·bash
好名字更能让你们记住我3 小时前
Linux多线程(十二)之【生产者消费者模型】
linux·运维·服务器·jvm·windows·centos
门思科技3 小时前
设计可靠 LoRaWAN 设备时需要考虑的关键能力
运维·服务器·网络·嵌入式硬件·物联网
小锋学长生活大爆炸3 小时前
【知识】RPC和gRPC
服务器·网络协议·rpc