ORM for Expo, Android Build. Error: Unable to resolve module .prisma/client/react-native
Hey everyone. I'm trying to run an Android expo build on a project with the react-native-prisma.
Here is my branch for reference: https://github.com/luketurnbull/todo-native-app/tree/lukes-local-first-todo
I'm getting the following error in the
Run gradlew
step.
Error: Unable to resolve module .prisma/client/react-native from /home/expo/workingdir/build/node_modules/@prisma/client/react-native.js: .prisma/client/react-native could not be found within the project or in these directories:
node_modules
1 | module.exports = {
2 | ...require('.prisma/client/react-native'),| ^ 3 | } 4 | prisma.schema: eas.json:
GitHub
GitHub - luketurnbull/todo-native-app at lukes-local-first-todo
Todo mobile app. Contribute to luketurnbull/todo-native-app development by creating an account on GitHub.
8 Replies
Hey @Luke ๐
I assume this is the same issue you are running into?
https://github.com/prisma/react-native-prisma/issues/45
Are you on Expo SDK 52 as well?
GitHub
Support Expo SDK 52 ยท Issue #45 ยท prisma/react-native-prisma
I'm not entirely certain what is going on here, but noting it here in case it's not just me. SDK 52 was released today, and after upgrading from 51 to 52 my app will no longer build on EAS....
Hello! Thanks for having a look, I saw this post too. I'm using expo 51, not 52, but possibly could be an issue on both of those?
I'm pretty new to expo so I wasn't sure if I need to update a configuration somewhere for the build.
Definitely possible that it's an issue with expo 51.
This is a working example:
https://github.com/sorenbs/budget-buddy-experimental-sync
Can you see if this works for you? Maybe then porting dependencies from this project to your actual project could work?
GitHub
GitHub - sorenbs/budget-buddy-experimental-sync
Contribute to sorenbs/budget-buddy-experimental-sync development by creating an account on GitHub.
I'll give it a go ๐ thanks for your input @Nurul .
I know the package is experimental for now but I really love it, the reactive queries are so nice. Is the package still actively being worked on?
No worries, happy to help! Package is not as actively worked upon as Prisma ORM. At the moment, I don't have a date on when Support for Expo would be in GA ๐
Hi Luke, I was facing the same issue and found a way to solve it by adding Prisma in devDependencies in package.json:
"devDependencies": {
...,
"prisma": "^5.22.0"
}.
I am using Expo SDK 51, @prisma/client and @prisma/react-native": 5.22.0. Hope this helps you ๐ .
Hi @kovacs ๐
Thank you for sharing the solution. This would be very helpful to other users who might stumble on this thread ๐
What a legend! I'll give this a go!