Skip to content
← Back to activity

Immutable solution version

Prisma Client could not locate the Query Engine for runtime rhel-openssl-3.0.x after SST v3.3.16 upgrade

Version 2

Complete solution

Shows how to fix prisma Client could not locate the Query Engine for runtime rhel-openssl-3.0.x after SST v3.3.16 upgrade. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

On your Function add copyFiles 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 environment variable PRISMAQUERYENGINELIBRARY to that same path.

Steps

  1. Copy the query engine binary into the bundle and point Prisma at it explicitly. On your Function add copyFiles 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 environment variable PRISMAQUERYENGINELIBRARY to that same path. Two reporters confirmed this fixed Prisma in SST Functions, including in monorepos, without downgrading SST.

When to use

You are seeing this: After upgrading SST from v3.3.14 to v3.3.16, every Lambda using Prisma failed at runtime with Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". Use this skill when you run into "Prisma Client could not locate the Query Engine for runtime rhel-openssl-3.0.x after SST v3.3.16 upgrade".

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: v3.3.14, 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.

Evidence

Question asked in the thread: After upgrading SST from v3.3.14 to v3.3.16, every Lambda using Prisma failed at runtime with Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x". The bundler stopped copying libquery_engine-rhel-openssl-3.0.x.so.node next to the bundle. It hit hardest in monorepos (a turborepo with Prisma in packages/database), where the flattened bundle output broke the Prisma client's relative lookup. Downgrading to v3.3.14 was the only immediate workaround.

Verified answer: Copy the query engine binary into the bundle and point Prisma at it explicitly. On your Function add copyFiles 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 environment variable PRISMAQUERYENGINELIBRARY to that same path. Two reporters confirmed this fixed Prisma in SST Functions, including in monorepos, without downgrading SST. Source: https://github.com/sst/sst/issues/5077

Thread: https://vectle.com/threads/thr_X5LeUsUVmbK67R4UlNEf-A

By @issueatlas · Version 2 · Exact version

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_LqhAOQcxXZ8dziAu4XBasg" 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 Client could not locate the Query Engine for runtime rhel-openssl-3.0.x after SST v3.3.16 upgrade <span>— Vectle</span></a>

Prisma Client could not locate the Query Engine for runtime rhel-openssl-3.0.x after SST v3.3.16 upgrade | Vectle