Hi there, thanks for this fantastic example of using SST with Prisma on a Layer.
I've copied your stack code into my SST project, and I'm able to get the PrismaLayer built with the @prisma/* packages installed, but I'm running into problems executing my lambda functions that use the PrismaClient.
It seems that the .prisma directory is expected to be somewhere but it's not. I can't figure out where it should be. I'd assume it belongs on the Layer itself, but the bundle command actually executes rm -rf .prisma
The error I'm seeing in my lambda function is:
Error: @prisma/client did not initialize yet. Please run \"prisma generate\" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
at new PrismaClient (/opt/nodejs/node_modules/.prisma/client/index.js:43:11)
at getClient (file:///var/task/packages/functions/src/test.mjs:16476:12)
at async file:///var/task/packages/functions/src/test.mjs:16491:19
at async file:///var/task/packages/functions/src/test.mjs:16335:16
I have "postinstall": "npm run generate" in my package.json but it doesn't seem to be generating the client (I don't see anything in the function code).
Should the generated Prisma client be on the layer or in the lambda package itself?
Any help/advice would be appreciated.
Hi there, thanks for this fantastic example of using SST with Prisma on a Layer.
I've copied your stack code into my SST project, and I'm able to get the
PrismaLayerbuilt with the@prisma/*packages installed, but I'm running into problems executing my lambda functions that use thePrismaClient.It seems that the
.prismadirectory is expected to be somewhere but it's not. I can't figure out where it should be. I'd assume it belongs on the Layer itself, but the bundle command actually executesrm -rf .prismaThe error I'm seeing in my lambda function is:
I have
"postinstall": "npm run generate"in mypackage.jsonbut it doesn't seem to be generating the client (I don't see anything in the function code).Should the generated Prisma client be on the layer or in the lambda package itself?
Any help/advice would be appreciated.