Closed SudoGetBeer closed 2 years ago
Are you able to share some more details around your project?
It worked and then I upgraded to SDK 43 and building with EAS.
Is this an Expo managed workflow project?
Yes the managed workflow.
Tried both the cli and manual.
And which version of @bugsnag/expo are you using?
Bugsnag version: tried 7.14 and 7.13
Have you tried the suggestions given in that error message?
Yes but it just says:
react-native link @react-native-community/netinfo
warn Calling react-native link [packageName] is deprecated in favor of autolinking. It will be removed in the next major release.
Autolinking documentation: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
error Unknown dependency. Make sure that the package you are trying to link is already installed in your "node_modules" and present in your "package.json" dependencies.
info Run CLI with --verbose flag for more details.
Hi @SudoGetBeer ,
I've managed to reproduce what you are seeing. If you try the following it should work:
npm i @react-native-community/netinfo@6.0.2
and then
react-native link @react-native-community/netinfo
Let me know if this works for you.
The command works now. But the app still crashes until I remove the Bugsnag import.
@johnkiely1 any other ideas?
I'm getting the same issue.
@SudoGetBeer @stephenb
I wonder if this is related to using EAS build? EAS build is not something we have tested with so its plausible this is causing the issue. Would it be possible to test running this with npm run ios
or expo run:ios
to see if we can narrow it down to be EAS build related?
@johnkiely1
I had the same error when using expo start --dev-client
. If that helps.
npm run ios
or expo run:ios
dont work for me. But I build a new testflight version with expo build:ios
and will test that
It seems it is the eas. With the old build the app don't crash on startup
@johnkiely1 Yes, I am in the process of switching to using EAS build. I'm assuming bugsnag's expo client had been assuming netinfo was natively available, but that has changed with EAS... but, I'm still getting up to speed on how this all works so not too certain.
I did come across this, https://forums.expo.dev/t/eas-build-does-not-install-dependencies-defined-in-other-node-modules/59178 which seems related. There is also this suggestion here which might help. Perhaps there is a way to ensure the netinfo dependency is loaded correctly via some EAS build config. I'm not sure what that would be as I'm not at all familiar with EAS build as it is not something that is officially supported by Bugsnag. We have a roadmap item to look into supporting it the future but we don't have an estimate for when this might be as yet.
Closing, as we believe this is a build issue related to EAS.
We plan to consider official support for Expo EAS Build in the future.
OK, and just to update the thread, I did fix my build by manually adding the netinfo dependency. Perhaps best-practice wrt EAS Build will be for 3rd party libs to specify these dependencies, but I'm not totally sure. Expo is moving towards EAS Build being the primary build process though, as the old build process will be phased out.
If anyone still has the issue using dev client, try running npx expo prebuild
and then eas build --platform all
. That was the issue on my end.
It works on expo go but on running on development build it gives error
ERROR 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 none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-netinfo, js engine: hermes
Describe the bug
If I use
import Bugsnag from '@bugsnag/expo'
I get this error log and the app crashes:Environment