Brunowilliang
Brunowilliang17mo ago

Error: While resolving module `convex/react` (React Native)

Hi guys, I'm facing this error when running the app with expo, can anyone help me?
error: Error: While resolving module `convex/react`, the Haste package `convex` was found. However the module `react` could not be found within the package. Indeed, none of these files exist:
error: Error: While resolving module `convex/react`, the Haste package `convex` was found. However the module `react` could not be found within the package. Indeed, none of these files exist:
No description
9 Replies
CodingWithJamal
CodingWithJamal17mo ago
can you send your package.json file?
Brunowilliang
BrunowilliangOP16mo ago
Hi @CodingWithJamal my package:
{
"name": "convex",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^13.0.0",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-navigation/native": "^6.0.2",
"@tamagui/babel-plugin": "^1.75.7",
"@tamagui/config": "^1.75.7",
"convex": "^1.5.1",
"expo": "~49.0.13",
"expo-font": "~11.4.0",
"expo-linking": "~5.0.2",
"expo-router": "^2.0.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"expo-system-ui": "~2.4.0",
"expo-web-browser": "~12.3.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.6",
"react-native-gesture-handler": "~2.12.0",
"react-native-get-random-values": "^1.9.0",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-svg": "13.9.0",
"react-native-web": "~0.19.6",
"tamagui": "^1.75.7",
"zustand": "^4.4.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@rocketseat/eslint-config": "^2.1.0",
"@types/react": "~18.2.14",
"eslint": "^8.51.0",
"jest": "^29.2.1",
"jest-expo": "~49.0.0",
"react-test-renderer": "18.2.0",
"typescript": "^5.1.3"
},
"overrides": {
"react-refresh": "~0.14.0"
},
"resolutions": {
"react-refresh": "~0.14.0"
},
"private": true
}
{
"name": "convex",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^13.0.0",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-navigation/native": "^6.0.2",
"@tamagui/babel-plugin": "^1.75.7",
"@tamagui/config": "^1.75.7",
"convex": "^1.5.1",
"expo": "~49.0.13",
"expo-font": "~11.4.0",
"expo-linking": "~5.0.2",
"expo-router": "^2.0.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"expo-system-ui": "~2.4.0",
"expo-web-browser": "~12.3.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.6",
"react-native-gesture-handler": "~2.12.0",
"react-native-get-random-values": "^1.9.0",
"react-native-reanimated": "~3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-native-svg": "13.9.0",
"react-native-web": "~0.19.6",
"tamagui": "^1.75.7",
"zustand": "^4.4.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@rocketseat/eslint-config": "^2.1.0",
"@types/react": "~18.2.14",
"eslint": "^8.51.0",
"jest": "^29.2.1",
"jest-expo": "~49.0.0",
"react-test-renderer": "18.2.0",
"typescript": "^5.1.3"
},
"overrides": {
"react-refresh": "~0.14.0"
},
"resolutions": {
"react-refresh": "~0.14.0"
},
"private": true
}
CodingWithJamal
CodingWithJamal16mo ago
looks like the error is coming from inside convex, so maybe try to delete and re-install your node_modules folder but i dont see anything abnormal about this .json file
Brunowilliang
BrunowilliangOP16mo ago
I've tried several times and still the same error...
CodingWithJamal
CodingWithJamal16mo ago
@jamwt wonder if you can help, since your online sorry for the ping...
ballingt
ballingt16mo ago
@Brunowilliang what version of Expo is this? I see
Brunowilliang
BrunowilliangOP16mo ago
I'm racking my brain here but I can't solve it
ballingt
ballingt16mo ago
I'm seeing "rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json and then restart packager" suggested for possibly related errors but that just sounds similar, I don't know if it's actually related to this oh! Don't name your package convex!
"name": "convex",
"name": "convex",
that might help There could be some confusion here both calling your package convex and trying to use convex as a dependency @Brunowilliang would love to hear if this helps
Brunowilliang
BrunowilliangOP16mo ago
@ballingt That was exactly it hahahaha, I still can't believe that that was the problem

Did you find this page helpful?