gpt4 book ai didi

vercel error: @prisma/client did not initialize yet. please run "prisma generate" and try to import it again(vercel错误:@prisma/client没有初始化.请运行“prisma generate”并尝试再次导入它)

转载 作者:bug小助手 更新时间:2023-10-28 21:00:50 25 4
gpt4 key购买 nike



- info Linting and checking validity of types...
- info Collecting page data...
Error: @prisma/client/edge did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
at new PrismaClient (/vercel/path0/node_modules/.prisma/client/edge.js:3:11)

Above one is the problem I got when I deployed on vercel with MongoDb (atlas URL) backend and prisma as ORM.

上面一个是我在Vercel上部署MongoDB(Atlas URL)后端和Prisma作为ORM时遇到的问题。


I observe that @prisma/client instance is missing in deployment time . I have created separate file prisma object and using across the app.

我观察到部署时缺少@prisma/client实例。我已经创建了单独的文件Prisma对象和整个应用程序使用。


How to solve this ?

如何解决这一问题?


更多回答
优秀答案推荐

I have solved this with below steps

我已经通过以下步骤解决了这个问题



  • update package.json file with "build": "npx prisma db push && npx prisma generate && next build"

  • Update the Environment Variables in vercel with NODE_ENV as production also make sure updated DATABASE_URL with current Atlas connection string.


Above steps helps to solve my problem.

以上几个步骤有助于解决我的问题。


更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com