Error: Invalid `prisma.model.findMany()` invocation. Query engine library for current platform "debian-openssl-1.1.x" could not be found.
I get the following error whenever I try to deploy my fullstack Next js prisma project on Netlify
op PrismaClientInitializationError:
10:22:45 AM: Invalid `prisma.vote.findMany()` invocation:
10:22:45 AM: Query engine library for current platform "debian-openssl-1.1.x" could not be found.
10:22:45 AM: You incorrectly pinned it to debian-openssl-1.1.x
10:22:45 AM: This probably happens, because you built Prisma Client on a different platform.
10:22:45 AM: (Prisma Client looked in "/opt/build/repo/node_modules/@prisma/client/runtime/libquery_engine-debian-openssl-1.1.x.so.node")
10:22:45 AM: Searched Locations:
10:22:45 AM: /opt/build/repo/node_modules/.prisma/client
10:22:45 AM: /opt/build/repo/node_modules/@prisma/client
10:22:45 AM: /opt/build/repo/node_modules/@prisma/client
10:22:45 AM: /opt/build/repo/node_modules/.prisma/client
10:22:45 AM: /opt/build/repo/prisma
10:22:45 AM: /tmp/prisma-engines
10:22:45 AM: /opt/build/repo/node_modules/.prisma/client
10:22:45 AM: To solve this problem, add the platform "debian-openssl-1.1.x" to the "binaryTargets" attribute in the "generator" block in the "schema.prisma" file:
10:22:45 AM: generator client {
10:22:45 AM: provider = "prisma-client-js"
10:22:45 AM: binaryTargets = ["native"]
10:22:45 AM: }
10:22:45 AM: Then run "prisma generate" for your changes to take effect.
10:22:45 AM: Read more about deploying Prisma Client: https://pris.ly/d/client-generator
10:22:45 AM: at fn.handleRequestError (/opt/build/repo/node_modules/@prisma/client/runtime/library.js:174:6750)
10:22:45 AM: at fn.handleAndLogRequestError (/opt/build/repo/node_modules/@prisma/client/runtime/library.js:174:5907)
10:22:45 AM: at /opt/build/repo/node_modules/@prisma/client/runtime/library.js:177:3087
10:22:45 AM: at async /opt/build/repo/node_modules/@prisma/client/runtime/library.js:177:3294
10:22:45 AM: at async t._executeRequest (/opt/build/repo/node_modules/@prisma/client/runtime/library.js:177:10748)
10:22:45 AM: at async t._request (/opt/build/repo/node_modules/@prisma/client/runtime/library.js:177:10477)
10:22:45 AM: at async loadVotes (/opt/build/repo/.next/server/pages/admin/votes.js:51:21)
10:22:45 AM: at async getStaticProps (/opt/build/repo/.next/server/pages/admin/votes.js:74:15)
10:22:45 AM: at async renderToHTML (/opt/build/repo/node_modules/next/dist/server/render.js:389:20)
10:22:45 AM: at async /opt/build/repo/node_modules/next/dist/export/worker.js:354:36 {
10:22:45 AM: clientVersion: '4.12.0',
10:22:45 AM: errorCode: undefined
10:22:45 AM: }
Admin
2023-05-15
I encountered a similar error recently, and I discovered a simple fix that worked for me. To resolve it, you can force Netlify to clear your deployment cache and initiate the deployment process again. Here's how:
- Go to your project's deployment history on Netlify.
- Locate and click on your last deployment.
- Click on the 'Retry' button.
- In the dropdown menu that appears, select 'Clear cache and retry with latest branch commit.'
- Wait for the deployment to complete successfully.
By following these steps, you can refresh the deployment and resolve any caching-related issues. Hope this helps!
Privacy Policy
By using our website,
you agree that devmaesters can store cookies on your device and disclose information in accordance with our privacy policy.