#ORM for Expo, Android Build. Error: Unable to resolve module .prisma/client/react-native

1 messages · Page 1 of 1 (latest)

open lance
#

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)
}

eas.json:

{
  "cli": {
    "version": ">= 5.9.1"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal"
    },
    "preview": {
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "production": {
      "android": {
        "buildType": "apk"
      }
    }
  }
}
GitHub

Todo mobile app. Contribute to luketurnbull/todo-native-app development by creating an account on GitHub.

red hill
open lance
red hill
open lance
#

I'll give it a go 🙂 thanks for your input @red hill .

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?

red hill
#

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 🙂

short epoch
#

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 👍 .

red hill
#

Hi @short epoch 🙌
Thank you for sharing the solution. This would be very helpful to other users who might stumble on this thread 🙂

open lance
frank raft
#

@short epoch I've been banging my head against this since this morning. Thank you for your help! Maybe you could add this to the issue in github?