Timur
PPrisma
•Created by Timur on 12/13/2024 in #help-and-questions
React Native Prisma TurboModuleRegistry error
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
Here is my index.tsx using reactive hook
My Prisma client setup
My dependencies
Does anyone know why this occurs?
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'Prisma' could not be found. Verify that a module by this name is registered in the native binary.
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'Prisma' could not be found. Verify that a module by this name is registered in the native binary.
...
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>
);
}
...
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>
);
}
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());
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());
"prisma": "^6.0.1",
"@prisma/client": "6.0.1",
"@prisma/react-native": "6.0.1",
"prisma": "^6.0.1",
"@prisma/client": "6.0.1",
"@prisma/react-native": "6.0.1",
5 replies