Nextjs function can't find binary on Netlify
See original GitHub issueBug description
Nextjs project deployed to netlify give giving me error on function. I already cleared the cache on my build process and added.
Build step prisma generate && next build
using yarn.
Prisma information
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}
Environment & setup
- OS: Debian (netlify)
- Database: MySQL
- Prisma version: 2.21.2
PrismaClientInitializationError2 [PrismaClientInitializationError]: 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
/tmp/prisma-engines
/var/task/node_modules/.prisma/client
You already added the platforms "native", "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
at cb (/var/task/src/nextPage/index.js:40268:17)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
clientVersion: '2.21.2',
errorCode: undefined
}
I am also using the db.ts specified in the next instructions:
declare global {
namespace NodeJS {
interface Global {
prisma: any;
}
}
}
let prisma: PrismaClient
if (process.env.NODE_ENV === 'production') {
prisma = new PrismaClient()
} else {
if (!global.prisma) {
global.prisma = new PrismaClient()
}
prisma = global.prisma
}
export default prisma
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Query engine binary could not be found on netlify deployment ...
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 >Troubleshooting Next.js on Netlify
Troubleshoot your Next.js application on our platform. Fix issues with large functions and dependencies.
Read more >Netlify won't deploy my Next.js+Prisma app
I'm having trouble deploying this basic Next.js app with Prisma to ... Prisma Client Binary Not Copied for Netlify Lambda Functions (For ...
Read more >Application deployed but with Errors 500 on pages where ...
I have a simple static blog using NextJS 13. I use getStaticProps on all of my pages. It works during development but the...
Read more >How to Include Files in Netlify Serverless Functions
A better approach is to find every require and import call in the code and mark each referenced file as being required for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@janpio I’m getting whenever I try to access the function via any http request.
I am going to close this. Please follow the latest netlify deployment guide from the documentation here now.