Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCWebViewModule' could not be found
Bug description:
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCWebViewModule' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: false. TurboModule interop: false.
Modules loaded: {
"NativeModules":
["PlatformConstants","LogBox","SourceCode","Timing","AppState","BlobModule","WebSocketModule","SettingsManager","DevSettings","Networking","RedBox","Appearance","DevLoadingView","DeviceInfo","UIManager","RNCSafeAreaContext","NativeAnimatedModule","I18nManager","StatusBarManager","StatusBarManager","ImageLoader","KeyboardObserver","AccessibilityManager","RNGestureHandlerModule","AsyncLocalStorage"],
"TurboModules":[],
"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","BugReporting","HeadlessJsTaskSupport","SoundManager","FrameRateLogger","AccessibilityInfo","PlatformLocalStorage","RNC_AsyncSQLiteDBStorage","RNCAsyncStorage","AsyncSQLiteDBStorage","RNCWebViewModule"]
},
js engine: hermes
ERROR Invariant Violation: "main" has not been registered. This can happen if:
example:example:ios: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
example:example:ios: * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes
Environment:
- OS: MacOS
- OS version: Sonoma 14.5
- react-native version: 0.73.2
- react-native-webview version: 13.10.5
- expo: ~50.0.17
+1
If you just updated the webview version, then do npx pod-install
It also happens on Android.
OS: macOS 14.5
CPU: (8) arm64 Apple M2
react-native: 0.73.7
Android:
hermesEnabled: true
newArchEnabled: false
react-native-webview: 13.10.5
Downgrading to "react-native-webview": "^12" works for me.
+1
+1
+1
+1
This error means you are using the new architecture & the native implementation of the RNCWebViewModule Turbomodule was not found by JS.
If you are using version => v13.10.5, you'll need to re-build the native code (using cocoapods or gradle) to ensure the native module is present.
iOS
rm -rf ios/build
rm -rf ios/Pods
cd ios && pod install
Android
cd android
./gradlew clean
The example in https://github.com/react-native-webview/react-native-webview/blob/master/example/App.tsx is using the new Turbomodule when new architecture is enabled.
Anyone know how to do this /\ in an expo project?
+1
downgrade to "react-native-webview": "~13.6.3",
downgraded to "react-native-webview": "~13.6.4" and it is working fine
I am still running into this issue after trying everything above.
If you are working in EXPO, You gotta do these 2 things to make sure it's working fine on both OS
(1) Android requires certain permissions to access the internet and other resources. Make sure you have the appropriate permissions set in your app.json file under the android.permissions key. { "expo": { "android": { "permissions": ["INTERNET"] } } }
AND (2) Expo has a separate package for WebView support. Make sure you are using the correct WebView component from the Expo ecosystem:
expo install react-native-webview
This works for me very well.
I degraded react-native-webview to 13.6.4
Thanks worked for me
I am still running into this issue after trying everything above.
Try degrading webview package
@ismailxkhalid Just a clarification, expo doesn't have a separate package if you look at deeply into the package its exactly the same. That expo command checks that the package that you give is valid with your current setup (aka your current SDK version etc etc) / installs the package version that is valid with your SDK version but its still this package / library.
I am using Expo and doing everything I can but still getting the error message. Is there any way to fix this please? I am losing days over this. Thank you!!
Have u tried degrading the react-native-webview pacakage?
I have but it doesn't seem to work
I don't remember exactly but I think it worked after a cache clean for me. react-native-webview version: 13.10.4 SDK version: 51.0.32
"react-native": "0.74.5", "expo": "~51.0.28", "react-native-webview": "13.10.5"
I'm sorry, I tried version 13.10.5 and all later versions, but the issue exists in all of them.
all the steps discussed above , doesn't work for me I was trying to migrate from bare react-native project to expo
got any other solution?
@anasvemmully Either downgrade <= 13.10.4 or use npx expo run:ios to use development builds. Expo Go doesn't support react-native-webview > 13.10.4.
I'm hoping there's another solution :(
I was experiencing this issue.
I ran the expo doctor:
npx expo install --check
This identified that my version of react-native-webview was not the correct version for Expo
After that, I rebuilt my development version of my app by executing:
eas build --platform android --profile development
Then ran my project clearing the cache:
npx expo start -c
I am no longer having this issue.
Amazing Expo! Wasting my time
all the steps discussed above , doesn't work for me I was trying to migrate from bare react-native project to expo
got any other solution?
Its version issues of packages, try fixing it use expo doctor
I think if you guy use expo, you should use comman
expo install
Try rebuilding your expo app.
eas build --profile development --platform android
or use the local flag to build locally
eas build --profile development --platform android --local
replace android with ios if you're building for ios.
Also run expo-doctor to make sure everything is fine.
expo install [email protected] expo start -c please add it on app.json file { "expo": { "jsEngine": "jsc" } }
I've been facing this issue for the past two days. Despite reading numerous articles and exploring various GitHub code examples, I wasn't able to achieve the expected results. However, after extensive effort, I was finally able to resolve and overcome the problem.
Quando for instalar o react-native-webview utilize o:
npx expo install react-native-webview
