Site ID: deductive-api-staging
Hi there,
I have a typescript express API in a monorepo at /apps/server
I am using node20 (20.10.0 in my .nvmrc)
I can build and deploy my app and I can get a response from my app when I access it, but I see errors:
PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x".\n\nThis is likely caused by a bundler that has not copied "libquery_engine-rhel-openssl-3.0.x.so.node" next to the resulting bundle.\nEnsure that "libquery_engine-rhel-openssl-3.0.x.so.node" has been copied next to the bundle or in "…/…/node_modules/.prisma/client"
My esbuild script copies the correct binary from my monorepo’s node_modules to the function folder:
copyPlugin({
resolveFrom: 'cwd',
assets: {
from: ['./../../node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node'],
to: ['./netlify/functions/api/'],
},
}),
I can see the file in the function build folder when I run this locally.
Despite this, the prisma client says it can’t find the file on production. I have tried all kinds of permutations here to try to resolve it, but to no avail. In my netlify,toml, under functions, I have:
included_files = ["./netlify/functions/api/libquery_engine-rhel-openssl-3.0.x.so.node"]
This has made no difference. I’ve tried various ways of writing the path.
Can anyone help? I’d be very grateful.
Many thanks.