-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@prisma/react-native failed to initialize, js engine: hermes #23
Comments
Hi there! Could you share additional details of what you did and the full error message you are seeing? |
I have the same error from doing this:
calling this in the useEffect of the first route |
I encountered the same issueFirst, I followed the tutorial from the Expo official website and used the following command to create a local test project: npx create-expo-app@latest Then I executed the following command to get a clean project: npm run reset-project Next, as per the project's README, I installed the dependencies: npm i --save --save-exact @prisma/client@latest @prisma/react-native@latest react-native-quick-base64 And according to the subsequent steps in the README, I completed the project initialization: {
"expo": {
// ... The rest of your expo config
"plugins": ["@prisma/react-native"]
}
} npx expo prebuild --clean I placed generator client {
provider = "prisma-client-js"
previewFeatures = ["reactNative"]
}
datasource db {
provider = "sqlite"
url = "file:./app.db"
}
model User {
id Int @id @default(autoincrement())
name String
} I also executed the following commands: npx prisma@latest migrate dev
npx prisma@latest generate Finally, I modified the code in import { Text, View } from "react-native";
import { PrismaClient } from '@prisma/client/react-native';
import { reactiveHooksExtension } from '@prisma/react-native';
const baseClient = new PrismaClient();
export const extendedClient = baseClient.$extends(reactiveHooksExtension());
export default function Index() {
const users = extendedClient.user.useFindMany();
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center",
}}
>
<Text>hello world</Text>
<Text>{JSON.stringify(users)}</Text>
</View>
);
} However, when I run the project, it displays the following error message: Android Bundled 7035ms node_modules/expo-router/entry.js (959 modules)
ERROR Error: 🟥 @prisma/react-native failed to initialize, js engine: hermes My development environment is as follows:
{
"name": "ceshi",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^14.0.0",
"@prisma/client": "5.15.1",
"@prisma/react-native": "5.15.1",
"@react-navigation/native": "^6.0.2",
"expo": "~51.0.14",
"expo-constants": "~16.0.2",
"expo-font": "~12.0.7",
"expo-linking": "~6.3.1",
"expo-router": "~3.5.16",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.6",
"expo-web-browser": "~13.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.2",
"react-native-gesture-handler": "~2.16.1",
"react-native-quick-base64": "2.1.2",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-web": "~0.19.10"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/jest": "^29.5.12",
"@types/react": "~18.2.45",
"@types/react-test-renderer": "^18.0.7",
"jest": "^29.2.1",
"jest-expo": "~51.0.1",
"react-test-renderer": "18.2.0",
"typescript": "~5.3.3"
},
"private": true
} |
Same issue! |
1 similar comment
Same issue! |
Same... |
I have the same issue as well it's linked to this one Prisma Integration Errors in React Native with Expo: Warnings and Import Failures |
I saw it and it even seems that's the most popular problem right now about this. |
Same issue! does anyone fixed it ? |
I also have this issue sadly. |
I fixed this error by running a |
sadly, facing the same issue, and pod install don't work on window(i guess) |
same issue |
Same issue here with android. Edit: After a little more digging, this cause for me was because I'm using Expo Go, which doesn't support Native Modules . |
How would this fixes this issue? |
Any news on this issue? I tried every possible scenarios and it just won't work. |
No description provided.
The text was updated successfully, but these errors were encountered: