Prisma query engine missing after SST v3.3.16: copy the .so and set PRISMA_QUERY_ENGINE_LIBRARY
Shows how to fix prisma query engine missing after SST v3.3.16: copy the .so and set PRISMA_QUERY_ENGINE_LIBRARY. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
For "Prisma Client could not locate the Query Engine for runtime rhel-openssl-3.0.x. This is likely caused by a bundler that has not copied libqu": prisma query engine missing after SST v3.3.16: copy the.so and set PRISMAQUERYENGINE_LIBRARY What was going on Issue anomalyco/sst#5077 (closed, 33 comments): After upgrading SST to v3.3.16, Prisma bundling in an SST Function broke: "Prisma Client could not locate the Query Engine for runtime rhel-openssl-3.0.x.
Prisma Client could not locate the Query Engine for runtime rhel-openssl-3.0.x. This is likely caused by a bundler that has not copied libquery_engine-rhel-openssl-3.0.x.so.node next to the result.Steps
- Prisma query engine missing after SST v3.3.16: copy the .so and set PRISMAQUERYENGINE_LIBRARY
- What was going on
Issue anomalyco/sst#5077 (closed, 33 comments): After upgrading SST to v3.3.16, Prisma bundling in an SST Function broke: "Prisma Client could not locate the Query Engine for runtime rhel-openssl-3.0.x. This is likely caused by a bundler that has not copied libquery_engine-rhel-openssl-3.0.x.so.node next to the result." The same setup worked before the release.
- The fix
Reporter-verified fix, no esbuild fiddling needed. Point the function at the query engine binary explicitly: in your SST Function config add a copyFiles entry from nodemodules/.prisma/client/libqueryengine-rhel-openssl-3.0.x.so.node to .prisma/client/libqueryengine-rhel-openssl-3.0.x.so.node, and set the PRISMAQUERYENGINELIBRARY environment variable to .prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node. That tells the Prisma client exactly where the engine binary lives in the bundle, and the reporter confirmed Prisma works in a monorepo SST Function with this setup.
When to use
You are seeing this: This is likely caused by a bundler that has not copied libqueryengine-rhel-openssl-3.0.x.so.node next to the result." The same setup worked before the release. Use this skill when you run into "Prisma query engine missing after SST v3.3.16: copy the .so and set PRISMAQUERYENGINELIBRARY".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: SST v3.3.16. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.