Query engine binary could not be found - netlify & vercel with sveltekit
See original GitHub issueBug description
I am receiving the following error with Sveltekit & Vercel (I had the same issue with Netlify, and tried Vercel due to other bug reports saying it solved the problem):
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/query-engine-rhel-openssl-1.0.x")
Searched Locations:
/.prisma/client
/vercel/path0/node_modules/@prisma/client
/var
/var/task
/var/task
/var/task
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.
I am using 2.20.1
due to #6899. Sveltekit uses Vite, so the workarounds in similar bugs raised referencing Next.js & webpack aren’t applicable.
How to reproduce
Add prisma to a sveltekit app and deploy to either netlify or vercel
Expected behavior
Expect prisma client to be able to make requests as per local machine.
Prisma information
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Environment & setup
- OS: Netlify & Vercel
- Database: PostgreSQL
- Node.js version: 14
- Prisma version: 2.20.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Deploying sveltekit app on vercel, problems (fetching ... - Reddit
It will spit out an error about not being able to find the schema and/or engine files. Solution: Add the following to your...
Read more >How to deploy a Prisma app to Vercel
In this guide, you will set up and deploy a Next.js app to Vercel. ... To avoid this error, add your Prisma query...
Read more >Prisma Client Binary Not Copied for Netlify Lambda Functions ...
This was the error mentioned: Invalid `prisma.user.findOne()` invocation: Query engine binary for current platform "rhel-openssl-1.0.x" could not be found. This ...
Read more >SvelteKit, Vercel and GSAP Business - GreenSock
I am trying to deploy my SvelteKit Website on Vercel, ... Even so, I get an error saying it can't find ScrollTrigger's module....
Read more >Profile for Netlify - Linknovate
How To Run Your SvelteKit App on Node.js To run your Svelte application on a server ... You can find themes here. cd...
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
I have the same issue. Here is a workaround I found.
With SvelteKit’s vercel adapter it bundles the SSR code into a script in
.vercel_build_output/functions/node/render
.The vercel adapter uses esbuild to bundle the SSR script. And esbuild seems to have problem with binary deps, at least it can not resolve Prisma query engine binary file.
We could just add a
postbuild
script intopackage.json
to copy over relevant files ourselves.Damn, thanks for spotting!