question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Next & Netlify: Query engine binary for current platform "rhel-openssl-1.0.x" could not be found.

See original GitHub issue

Bug description

I’m using next@11.1.0 with prisma@2.30.0 and I’m trying to deploy it on Netlify (serverless). Locally is working okay, but when I’m deploying it I have the following error:

{
message: "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 "/var/task/netlify/functions/next_api_views/nextPage/chunks/query-engine-rhel-openssl-1.0.x") Searched Locations: /var/task/netlify/functions/.prisma/client /home/runner/work/bereghici.dev/bereghici.dev/common/temp/node_modules/.pnpm/@prisma+client@2.30.0_prisma@2.30.0/node_modules/@prisma/client /var/task/netlify/functions/next_api_views/nextPage /var/task/netlify/functions/next_api_views/nextPage/chunks /var/task/netlify/functions/next_api_views/nextPage/chunks /tmp/prisma-engines /var/task/netlify/functions/next_api_views/nextPage/chunks You already added the platforms "debian-openssl-1.1.x", "rhel-openssl-1.0.x" 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/issues/new"
}

You can see the error here: https://6128d3ecc5a191be338765d7--development-bereghicidev.netlify.app/api/views

Source code: https://github.com/abereghici/bereghici.dev/tree/prisma/apps/blog

How to reproduce

Deploy a simply nextjs & prisma app to netlify

Expected behavior

Prisma client should work on Netlify.

Prisma information

datasource db {
  provider = "mysql"
  url = env("DATABASE_URL")
  shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
  planetScaleMode = true
}

generator client {
  provider = "prisma-client-js"
  previewFeatures = ["planetScaleMode"]
  binaryTargets = ["native", "rhel-openssl-1.0.x"]
}

model views {
  id    BigInt @id @default(autoincrement())
  slug  String @db.VarChar(1024)
  count BigInt @default(0)
}

Environment & setup

  • OS: MacOS
  • Database: MySQL ( planetscale )
  • Node.js version: v14.17.2

Prisma Version

2.30.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
abereghicicommented, Aug 30, 2021

@janpio I was able to use Prisma on Netlify by configuring next target to experimental-serverless-trace. The issue appears only when I’m using the serverless target. It can be easily reproduced using this repo https://github.com/abereghici/nextjs-prisma-test

1reaction
abereghicicommented, Aug 30, 2021

@janpio Here is a repo where I’m able to reproduce the error:

https://github.com/abereghici/nextjs-prisma-test

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query engine binary could not be found on netlify ...
Bug description Query engine binary for current platform "rhel-openssl-1.0.x" could not be found. This probably happens, because you built ...
Read more >
Netlify Forms with Next.JS not detected - Support
Hello guys, I have a subscribing newsletter forms inside a component that called in a page. I've done adding this attribute on my...
Read more >
Prisma Client Binary Not Copied for Netlify Lambda ...
findOne()` invocation: Query engine binary for current platform "rhel-openssl-1.0.x" could not be found. This probably happens, because you built Prisma ...
Read more >
Deployment of NextJs website - page not found
I want to deploy a Next Js website, I followed this tutorial: I used Netlify UI I got: " Page Not Found" the...
Read more >
Netlify won't deploy my Next.js+Prisma app
I'm having trouble deploying this basic Next.js app with Prisma to ... which might be related: Query engine binary could not be found...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found