Query engine binary not found in NextJS with custom output #2299
Labels
bug/1-unconfirmed
Bug should have enough information for reproduction, but confirmation has not happened yet.
kind/bug
A reported bug.
tech/typescript
Issue for tech TypeScript.
Milestone
Bug description
When specifying a custom output in prisma.schema
Prisma client is unable to find the query engine binary when used in a NextJS server-side function. It is looking for the binary in the root of my filesystem (!) instead of in the generated prisma client directory.
If I remove the custom output directory and import from
@prisma/client
, everything works as expected.I suspect this is due to webpack resolving
__dirname
to/
(see: webpack/webpack#1599)How to reproduce
I can probably put together a full repro if needed, but at a high level:
getStaticProps
orgetServerSideProps
after importingPrismaClient
from custom output directoryprisma generate
import {PrismaClient} from '@prisma/client
Expected behavior
Expect to be able to import from my custom output directory
Prisma information
Environment & setup
The text was updated successfully, but these errors were encountered: