prisma: prisma 5.6.0 `libquery_engine-darwin-arm64.dylib.node` regression

Bug description

Prisma Client could not locate the Query Engine for runtime "darwin-arm64".

This is likely caused by a bundler that has not copied "libquery_engine-darwin-arm64.dylib.node" next to the resulting bundle.
Ensure that "libquery_engine-darwin-arm64.dylib.node" has been copied next to the bundle or in "node_modules/.prisma/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

The following locations have been searched:
  /Users/cipri/dev/acme/mono/apps/ops/node_modules/.prisma/client
  /Users/cipri/dev/acme/mono/apps/ops/.next/server
  /Users/cipri/dev/acme/mono/packages/db/node_modules/@prisma/client
  /Users/cipri/dev/acme/mono/apps/ops/.prisma/client
  /tmp/prisma-engines

How to reproduce

Monorepo setup

Prisma randomly fails with errors that it cannot find the schema or the runtime. I am using accelerate. Started happening with the latest 5.6.0

Expected behavior

As you can see the prisma db module is used in a nextjs app called ops

The prisma script is searching everywhere except for where it actually should which is

/Users/cipri/dev/acme/mono/packages/db/node_modules/.prisma/client

Not to add that the .prisma/client and @prisma/client generated folders is confusing af

Prisma information

Not relevant

Environment & setup

  • OS: mac
  • Database: postgres
  • Node.js version: 18.17.1

Prisma Version

5.6.0

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 24 (12 by maintainers)

Most upvoted comments

I ran into the same issue using the same monorepo provided above, and with the env variable @Jolg42 mentioned I got it to work. It feels really hacky but this did it for me:

PRISMA_QUERY_ENGINE_LIBRARY="../../node_modules/.pnpm/@prisma+client@5.15.0_prisma@5.15.0/node_modules/.prisma/client/libquery_engine-darwin-arm64.dylib.node"

Hi @millsp, thanks for your replies here, will try to setup a repro example, the only problem is that this randomly happens when I add various packages. It’s really just this template with another web app, will try to create that for you

https://github.com/t3-oss/create-t3-turbo