After setup prisma using PNPM in your project by following this official prisma setup. You getting error by import PrismaClient like below:
Before jump to the solution, this is my schema.prisma
config file:
This problem happen because after run pnpm exec prisma generate
, file node_modules/.prisma/client
not generated. For my suggestion solution, you need to adding schema.prisma
with additional output
configuration like below:
After adding that, run pnpm exec prisma generate
again. And Ta-Da, your problem have been solved!
If you look at the node_module
folder, you can see .prisma
folder generated successful!
Hope this solution help you!