← All fixes
Prisma Client could not locate the Query Engine for runtime
#156Error
PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". This happened because Prisma Client was generated for "windows", but the actual deployment required "rhel-openssl-3.0.x".
Why it happens, and why this works
Prisma's engine is a native binary built per OS. The client was generated on one platform (your laptop) or the generate step never ran on the deploy machine, so the binary for the server's OS isn't in the bundle.
Fix
1. Run prisma generate during the build: add "postinstall": "prisma generate" to package.json (or prefix the build script: "build": "prisma generate && next build").
2. Add the server platform to the generator: generator client { provider = "prisma-client-js" binaryTargets = ["native", "rhel-openssl-3.0.x"] } (use the runtime name from the error).
3. In a monorepo, make sure the generated client folder is included in the deployed output.
4. Newer Prisma versions can run without the native engine (query compiler / driver adapters), which removes this class of error.Did it work?
No reports yet0 worked0 didn't
Tried it yourself?
Related fixes
Prisma on Vercel: outdated Prisma Client because Prisma's auto-generation isn't triggered
#129Prisma has detected that this project was built on Vercel, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the `prisma generate` command during the build process.
@prisma/client did not initialize yet. Please run "prisma generate"
#130Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
Generated tsvector column fails: generation expression is not immutable
#14ERROR: generation expression is not immutable
postgresVerifiedNo reports yet