Using Prisma Client in a Next.js project in a monorepo setup
tip
If you want to learn how to build an app with Next.js and Prisma ORM, check out this comprehensive video tutorial.
Problem
If you use Prisma Client in a Next.js application within a monorepo, you may run into an error that looks similar to:
Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".
We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.
This is likely caused by tooling that has not copied "libquery_engine-debian-openssl-3.0.x.so.node" to the deployment folder.
Ensure that you ran \`prisma generate\` and that "libquery_engine-debian-openssl-3.0.x.so.node" has been copied to "generated/client".
We would appreciate if you could take the time to share some information with us.
Please help us by answering a few questions: https://pris.ly/engine-not-found-tooling-investigation
or:
Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".
We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.
This is likely caused by a bundler that has not copied "libquery_engine-debian-openssl-3.0.x.so.node" next to the resulting bundle.
Ensure that "libquery_engine-debian-openssl-3.0.x.so.node" has been copied next to the bundle or in "generated/client".
We would appreciate if you could take the time to share some information with us.
Please help us by answering a few questions: https://pris.ly/engine-not-found-bundler-investigation
Assume you have a monorepo with the following structure:
.
├── packages
│ ├── db