- 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.
I observe that @prisma/client instance is missing in deployment time . I have created separate file prisma object and using across the app.
How to solve this ?
I have solved this with below steps
package.json
file with "build": "npx prisma db push && npx prisma generate && next build"
NODE_ENV
as production
also make sure updated DATABASE_URL
with current Atlas connection string.Above steps helps to solve my problem.