Hey guys, I've been struggling for a few days now....
# prisma-client
d
Hey guys, I've been struggling for a few days now. I am deploying a function to an AWS lambda, which uses the Prisma Client. I have been using the version 2 for quite some time and am trying to update to version 4, but even after updating all packages and generating DB, I'm always getting the @prisma/client did not initialize yet error. Any idea why this could be?
✅ 1
r
Hi @Dávid Korečko 👋 Have you looked at this resource
d
Yep, already doing all those things, except I got to one of the points. It seems that in the generated node_modules/.prisma/client folder I am missing the engine files. Maybe that could be the issue?
r
Give it a try and let me know if it works for you.
d
I manually dragged the engine files there, but to no avail, still receiving the same error. Any other ideas?
r
Did you try deleting Prisma engines that are not required?
d
Actually scratch that, the prisma folder does not get deployed to be precise, just the .prisma and @prisma ones
r
This looks good but i can't say what is wrong at the moment. Did you also get a chance to look at the deployment guide to aws lambda
d
I've gone through that already since I fee llike I've read every possible form of documentation related to this error or using Prisma with AWS 😄 What confuses me is that the older version (version 2) worked perfectly fine, the only thing that's changed is the Prisma and Prisma client version in package.json and package-lock.json to version 4. Even on this new version, it works locally, works for integration tests, just not the lambda. Is there nothing that has changed between those versions?
r
Can you add this script to your package.json file?
Copy code
"postinstall": "prisma generate"
d
Which package.json should this be in? The one in packages or the one for the entire repository?
r
The one for the entire repository
d
No difference. Also, I've narrowed it down to being upgraded from version 2 to version 3 as being the issue.
Tested it with Prisma version 3 and same thing happens, it's working locally but not when deployed to AWS, same error
r
Can you share a minimal repository where i can try to reproduce this error on deploy to AWS lamdba?
d
Sadly I don't think I can since this is a work project, so can't share parts, but also don't know enough about AWS and CI/CD to recreate a minimal version of the project, apologies
But we're prolly gonna stick with prisma 2 for now since it's not a priority rn
Thanks for all your help though, I really appreciate it ^^
r
You're welcome