I am trying to use the package @prisma/client in an action to add a userId based on the incoming user’s email address. When I try to save my action after adding the dependency @prisma/client@latest I see the error:
" Error! The action failed to build. Double check your dependencies and try again."
I tried that, and was able to add a dependency “prisma” with @latest or @4.8.1, but, unfortunately, that didn’t work. Once deployed, while trying to log in, I get the error:
“Cannot find module ‘prisma/client’”
I have tried to include the dependency as “@prisma” “prisma” “prisma/client” and “@prisma/client” now and while the “prisma” dependency does seem to deploy, it doesn’t work in runtime. This is what I am following: Prisma Client
I don’t have any experience with Prisma, so please pardon my ignorance…How would this work if there is no schema for Prisma to read on installation? This would explain why adding the @prisma/client dependency is failing.
@dan.woda now you have me questioning what I am really doing in my life.
I don’t know if I was trying to do this because I saw it done elsewhere of if I just tried to tie Prisma into my Auth0 setup after discovering Actions. Maybe it was previously a Rule and now with Actions it is less possible to include a prisma schema? IDK.
I will look into a way to preload a prisma client with a schema from a URL or something. If I come up with something that works I will circle back here with my solution.
Another option would be to build a lightweight API around your Prisma client that excepts requests from an Action and makes the necessary changes. You could probably do this is a serverless function or something of that nature.