Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the prisma extension to force binaryTarget of debian-openssl-3.0.x #1358

Open
ericallam opened this issue Sep 26, 2024 · 7 comments
Open

Comments

@ericallam
Copy link
Member

ericallam commented Sep 26, 2024

If you see this error:

PrismaClientInitializationError: 
Invalid `prisma.users.findUnique()` invocation:


Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".

This happened because Prisma Client was generated for "debian-openssl-1.1.x", but the actual deployment required "debian-openssl-3.0.x".
Add "debian-openssl-3.0.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "debian-openssl-3.0.x"]
}

The following locations have been searched:
  /app/node_modules/.prisma/client
  /

You can fix it yourself by adding "native", "debian-openssl-3.0.x" to your binaryTargets array, like it says in the error above. Prisma allows generating many targets so this shouldn't impact your existing app that uses Prisma, it just means that Trigger.dev can also work.

Prisma extension

We need to investigate whether we can solve this automatically without requiring any changes to the prisma schema file, by adding some code to our prisma extension somehow.

@elie222
Copy link
Contributor

elie222 commented Oct 1, 2024

Also seeing this on 3.0.9. Worked fine on 56 beta:

◇  Failed to deploy project
│
■  Error: PrismaClientInitializationError
│  
│         PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".
│         
│         This happened because Prisma Client was generated for "darwin-arm64", but the actual deployment required "debian-openssl-3.0.x".
│         Add "debian-openssl-3.0.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:
│         
│         generator client {
│           provider      = "prisma-client-js"
│           binaryTargets = ["native", "debian-openssl-3.0.x"]
│         }

@elie222
Copy link
Contributor

elie222 commented Oct 1, 2024

Adding binaryTargets = ["native", "debian-openssl-3.0.x"] and running prisma generate results in this error:

Error: PrismaClientInitializationError
│  
│         PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".
│         
│         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 "../node_modules/.pnpm/@[email protected][email protected]/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:

Reverting my Trigger package update for now.

@elie222
Copy link
Contributor

elie222 commented Oct 1, 2024

Can confirm that reverting to 3.0.0-beta.56 fixes the issues.

@elie222
Copy link
Contributor

elie222 commented Oct 1, 2024

I'm using a Turborepo btw. prisma is installed in the web app where I'm trying to run trigger deploy

@ericallam
Copy link
Member Author

@elie222 did you use the prisma extension when using 3.0.9?

@elie222
Copy link
Contributor

elie222 commented Oct 2, 2024

@elie222 did you use the prisma extension when using 3.0.9?

Didn't try it. Will try tomorrow. Thanks!

@CloudCodesStuff
Copy link

Tried the prisma extension on 3.1.2 and still seeing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants