P
Prismaโ€ข2w ago
Luke

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:
generator client {
provider = "prisma-client-react-native"
previewFeatures = ["reactNative"]
}

datasource db {
provider = "sqlite"
url = "file:./app.db"
}

model Todo {
id Int @id @default(autoincrement())
title String
completed Boolean @default(false)
}
generator client {
provider = "prisma-client-react-native"
previewFeatures = ["reactNative"]
}

datasource db {
provider = "sqlite"
url = "file:./app.db"
}

model Todo {
id Int @id @default(autoincrement())
title String
completed Boolean @default(false)
}
eas.json:
{
"cli": {
"version": ">= 5.9.1"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal",
"android": {
"buildType": "apk"
}
},
"production": {
"android": {
"buildType": "apk"
}
}
}
}
{
"cli": {
"version": ">= 5.9.1"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal",
"android": {
"buildType": "apk"
}
},
"production": {
"android": {
"buildType": "apk"
}
}
}
}
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
Nurul
Nurulโ€ข2w ago
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....
Luke
LukeOPโ€ข2w ago
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.
Nurul
Nurulโ€ข2w ago
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.
Luke
LukeOPโ€ข2w ago
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?
Nurul
Nurulโ€ข2w ago
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 ๐Ÿ™‚
kovacs
kovacsโ€ข2w ago
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 ๐Ÿ‘ .
Nurul
Nurulโ€ข2w ago
Hi @kovacs ๐Ÿ™Œ Thank you for sharing the solution. This would be very helpful to other users who might stumble on this thread ๐Ÿ™‚
Luke
LukeOPโ€ข5d ago
What a legend! I'll give this a go!
Want results from more Discord servers?
Add your server