bugsnag-js: Expo SDK 43 Error: @react-native-community/netinfo: NativeModule.RNCNetInfo is null.
Describe the bug
If I use import Bugsnag from '@bugsnag/expo' I get this error log and the app crashes:
Error: @react-native-community/netinfo: NativeModule.RNCNetInfo is null. To fix this issue try these steps:
• Run `react-native link @react-native-community/netinfo` in the project root.
• Rebuild and re-run the app.
• If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.
• Check that the library was linked correctly when you used the link command by running through the manual installation instructions in the README.
* If you are getting this error while unit testing you need to mock the native module. Follow the guide in the README.
If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-netinfo
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules/metro-runtime/src/polyfills/require.js:204:6 in guardedLoadModule
at http://192.168.178.52:8081/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:130574:3 in global code
RCTBridge required dispatch_sync to load RCTDevLoadingView. This may lead to deadlocks
at node_modules/react-native/Libraries/Utilities/RCTLog.js:34:8 in logIfNoNativeHook
Invariant Violation: "main" has not been registered. This can happen if:
* 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.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
Environment
- Bugsnag version: tried 7.14 and 7.13
- Device (e.g. iphonex): iphone 11
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (5 by maintainers)
If anyone still has the issue using dev client, try running
npx expo prebuildand theneas build --platform all. That was the issue on my end.