DEV Community

Cover image for How I fixed Module '"@prisma/client"' has no exported member 'PrismaClient'.ts
Paul C. Ishaili
Paul C. Ishaili

Posted on

How I fixed Module '"@prisma/client"' has no exported member 'PrismaClient'.ts

I switched to using pnpm over npm and yarn after discovering the benefits over the other package manager for developments.

So today i ran into the bug in the image, stating that Module '"@prisma/client"' has no exported member 'PrismaClient'.ts.

Prisma import error in nextjs using pnpm

First, I thought this is an issue related to the prisma or @prisma/client package, until I browse through the web and discovered opened issues regarding this same error. it was coming from the pnpm package.

This github issue thread really helped: https://github.com/prisma/prisma/issues/13672.

How I fixed?

I navigated to prisma.schema file and updated my generator client block of code to this:

generator client {
  provider = "prisma-client-js"
  output   = "../node_modules/.prisma/client"
}
Enter fullscreen mode Exit fullscreen mode

After which, I ran the npx prisma generate command again, and 💥 Boom! Module import error got fixed! 🎉

Thanks for reading, and I am happy to help.

Remember to check out the GITHUB THREAD.

Follow me on Twiiter for more interesting updates!

Top comments (0)