#React Native Prisma TurboModuleRegistry error

4 messages · Page 1 of 1 (latest)

elder elbow
#

I am trying to create an app with React Native using Prisma.
When I try to open the application on my Android phone I get an

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'Prisma' could not be found. Verify that a module by this name is registered in the native binary.

Here is my index.tsx using reactive hook

...

export default function Home() {
  const data = hooksPrisma.testhaha.useFindMany()
  return (
    <SafeAreaView className="flex-1">
      <Stack.Screen options={{ headerShown: false }} />
      <VStack className="flex-1 items-center justify-center p-4 gap-4">
        <Button className="w-full" >
          <Text className="text-white">Show Test Data</Text>
        </Button>

        {data && (
          <VStack className="w-full">
            {data.map((item, index) => (
              <Text key={index}>{JSON.stringify(item)}</Text>
            ))}
          </VStack>
        )}
      </VStack>
    </SafeAreaView>
  );
}

My Prisma client setup

import { PrismaClient } from "@prisma/client/react-native";
import {
  reactiveHooksExtension,
  reactiveQueriesExtension,
} from "@prisma/react-native";

export const prisma = new PrismaClient({
  log: [{ emit: "event", level: "query" }],
});

export const hooksPrisma = prisma.$extends(reactiveHooksExtension());
export const extendedClient = prisma.$extends(reactiveQueriesExtension());

My dependencies

    "prisma": "^6.0.1",
    "@prisma/client": "6.0.1",
    "@prisma/react-native": "6.0.1",

Does anyone know why this occurs?

whole turtleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

elder elbow
#

Under android/app/build.gradle I see on the last line apply from: "../../node_modules/@prisma/react-native/react-native-prisma.gradle" so I don't get why the error occurs

plucky stream
#

Hi @elder elbow

Can you please share this question in the #orm-for-expo-feedback channel to get the needed help?