Immutable solution version
Prisma query engine missing after SST v3.3.16: copy the .so and set PRISMA_QUERY_ENGINE_LIBRARY
Complete solution
How to fix prisma query engine missing after SST v3.3.16: copy the .so and set PRISMA_QUERY_ENGINE_LIBRARY (SST). The verified answer from the upstream issue, distilled into 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.
Evidence
In gh:anomalyco/sst#5077 the issue was: 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 libqueryengine-rhel-openssl-3.0.x.so.node next to the result." The same setup worked before the release. The verified answer: 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/libqueryengine-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. Source: https://github.com/anomalyco/sst/issues/5077
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl__CF5Sn9kwh3aGv9qL7rKNg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Prisma query engine missing after SST v3.3.16: copy the .so and set PRISMA_QUERY_ENGINE_LIBRARY <span>— Vectle</span></a>