P
Prisma2mo ago
Yoni

AWS SAM + Lambda not bundling properly.

Hi guys. I'm writing an AWS SAM template in which I am setting up Prisma with my Lambda functions to interact with my RDS Postgres DB. I am facing an error that I suspect might be related to the query engine and prisma.schema not being bundled with the code. The error I am getting is:
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 resulting bundle. Ensure that \"libquery_engine-rhel-openssl-3.0.x.so.node\" has been copied next to the bundle or in \"../../node_modules/.prisma/client\".
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 resulting bundle. Ensure that \"libquery_engine-rhel-openssl-3.0.x.so.node\" has been copied next to the bundle or in \"../../node_modules/.prisma/client\".
Clearly theres an issue with the client being generated for my local machine rather than the lambda. I even tried this in my prisma client instatiation but no luck:
import schema from './prisma/schema.prisma'
import x from './node_modules/.prisma/client/libquery_engine-rhel-openssl-1.0.x.so.node'

if (process.env.NODE_ENV !== 'production') {
console.debug(schema, x)
}
import schema from './prisma/schema.prisma'
import x from './node_modules/.prisma/client/libquery_engine-rhel-openssl-1.0.x.so.node'

if (process.env.NODE_ENV !== 'production') {
console.debug(schema, x)
}
I also tried setting this in the lambda's environment variables: PRISMA_QUERY_ENGINE_LIBRARY: /opt/nodejs/node_modules/.prisma/client/libquery_engine-rhel-openssl-1.0.x.so.node (Deps in layers) Any help would be appreciated. Cheers!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server