Moh*_*ian 2 next.js vercel prisma
Recently I've tried to add two new items to one of my tables in my Prisma schema. After I update my database (using Prisma DB push) and try to .create a new data for my table I face some issues. On my localhost the project is fine and all the APIs are working correctly. but when I deploy the project on the server (using Vercel) it throws an error:
this is my saveFormData.ts ( the API for saving data ) :

p.s: I'm using next.js + Prisma :
我通过在 package.json 文件中添加一些脚本来修复它:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"vercel-build": "prisma generate && prisma db push && next build",
"prisma:generate": "prisma generate"
},
Run Code Online (Sandbox Code Playgroud)
ps:您可以使用 migrate deployprisma db Push 代替
| 归档时间: |
|
| 查看次数: |
1383 次 |
| 最近记录: |