- 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.
以上几个步骤有助于解决我的问题。
更多回答
我是一名优秀的程序员,十分优秀!