prisma: Query engine binary could not be found on netlify deployment with Next
Bug description
Query engine binary for current platform "rhel-openssl-1.0.x" could not be found. This probably happens, because you built Prisma Client on a different platform. (Prisma Client looked in "/query-engine-rhel-openssl-1.0.x") Searched Locations: /.prisma/client /opt/build/repo/node_modules/@prisma/client / /var/task/node_modules/.prisma/client /var/task /var/task/node_modules/.prisma/client You already added the platforms "native", "rhel-openssl-1.0.x", "darwin" to the "generator" block in the "schema.prisma" file as described in https://pris.ly/d/client-generator, but something went wrong. That's suboptimal. Please create an issue at https://github.com/prisma/prisma-client-js/issues/new
Note:
checked the following:
https://github.com/netlify/zip-it-and-ship-it/issues/81
https://github.com/prisma/prisma/issues/1015
https://github.com/netlify/build/issues/730#issuecomment-615177926
How to reproduce
Deploy a simply nextjs + prisma app to netlify
Expected behavior
Prisma client should do CRUD as usually.
Prisma information
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x", "darwin"]
previewFeatures = ["createMany"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Environment & setup
- OS: Netlify
- Database: Postgres
- Node.js version: 12.18.0
- Prisma version: 2.18.0
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 30 (10 by maintainers)
Links to this issue
Commits related to this issue
- apply recommended fix for netlify / prisma deployment issue https://github.com/prisma/prisma/issues/6051#issuecomment-831136748 — committed to schoblaska/jotrecipes by schoblaska 2 years ago
Netlify’s bundling tool
zip-it-and-ship-itincludes your dependency files into the zip file by looking at your imports. Sincenextrewrites all imports withwebpack,zip-it-and-ship-itwill not see the import and files such as binaries won’t be bundled. Netlify is working on a general solution for these kind of issues, but without any concrete date yet. I propose this workaround, where we simply exclude@prisma/clientfrom being bundled:next.config.js
Confirmed
TypeError: debugLib is not a functionis no longer happening. Thanks for the fix!Thanks everyone, in the latest dev version, we fixed the
debugLib is not a functionproblem. It’ll get released in2.20.0today.The original error reported in this issue
binary for current platform "rhel-openssl-1.0.x" could not be foundis not fixed by this though. We will continue investigating that next sprint.It is reproducible, we will patch it or document a workaround. Stay tuned.
I’m not using netlify and am getting this issue after upgrade from 2.17.? to 2.20.1:
@timsuchanek Was this definitely fixed in 2.20 ?
We have an idea what might be going on and are investigating.
Also having this issue with a next.js app deployed to netlify: https://github.com/jhackett1/example-deploy-to-netlify-app
Are we any closer to a resolution or workaround?
Deploying the same app to Vercel works fine: https://example-deploy-to-netlify-app.vercel.app/
@webnoob since this issue is about
Query engine binary could not be found on netlify deploymentI will mark thedebugLib is not a functionmessages off topic to keep the issue clean.Glad you’re unblocked!
i seem to still be getting the original issue on version
2.20.1😦you can see the repo i’m trying to deploy here: https://github.com/jhackett1/sms-message-tool
i was getting the “debuglib” issue before, so this is progress of a sort, i suppose!
I’ve had
TypeError: debugLib is not a functionhappening locally. Next.js (latest version), macOS. Downgrading Prisma to2.18.0fixed it.this error is happening on localhost Windows 10 too.
repo: https://github.com/s-kris/test-prisma-netlify
hey @pantharshit00 looks like
Query engine binaryis with2.18.0Link: https://cocky-babbage-06fac3.netlify.app/api/prisma-test branch: masterI’m able to reproduce the
TypeError: debugLib is not a functionwith2.19.0Link: https://60533b09c4bfae0007861e2c--cocky-babbage-06fac3.netlify.app/api/prisma-test branch: p2.19Thanks for your time 😃
Minimal repo https://github.com/s-kris/test-prisma-netlify You need to visit /api/prisma-test to see the error response.