Prisma query engine missing after SST v3.3.16: copy the .so and set PRISMA_QUERY_ENGINE_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 node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node to .prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node, and set the PRISMA_QUERY_ENGINE_LIBRARY 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.