question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sentry internal isNativeFetch function found to be undefined and crashes iOS app on RN 0.64.2

See original GitHub issue

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which SDK and version? @sentry/react-native: 2.5.1 @sentry/browser: 6.7.1 @sentry/hub: 6.7.1 @sentry/tracing: 6.7.1

Steps to Reproduce

  1. Use latest sentry react-native library with react-native 0.64.2.

  2. Once the app is built using fastlane and pushed to Testflight, opening the app crashes on any iOS device with Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: TypeError: s.isNativeFetch is not a function. (In 's.isNativeFetch(o.fetch)', 's.isNativeFetch' is undefined)', reason: 'Unhandled JS Exception: TypeError: s.isNativeFetch is not a function. (In 's.isNativeFetch(o.fetch)', 's.isNativeFetch' is undefined)

Note that it works fine with react-native 0.63.2. We searched our codebase for isNativeFetch and we found that it’s an internal function inside our sentry dependencies.

Expected Result

App to not crash 😃

Actual Result

Here’s a screenshot from the iOS app device log: Screenshot 2021-06-18 at 15 54 18

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chicocommented, Jun 22, 2021

@jennmueng https://github.com/necolas/react-native-web is quite popular (e.g. expo web uses it) so it might be worth considering but to be honest we’ve not needed direct web support as it’s easy to have sentry setup for both native and web, i.e. we have a /app/platform/sentry/index.js that proxies @sentry/react-native and /app/platform/sentry/index.web.js that proxies @sentry/browser and then in our code we reference /app/platform/sentry and that will use the correct proxy depending if running on native or web.

1reaction
chicocommented, Jun 20, 2021

@jennmueng we wouldn’t normally include the other sentry dependencies but we’re using react-native-web so that the same codebase works both on the mobile app & web app and for the web we have to include @sentry/browser and other necessary dependencies. But good point regarding using the correct version (thanks!), even though it seems to be working fine we will downgrade to 6.5.1 and see if it works ok 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS crash on launching the app · Issue #785 - GitHub
I have following issue: On iOS, when trying to run the app in release mode the app crashes, even if I don't have...
Read more >
IOS (React-native) app crashes in … | Apple Developer Forums
Hi, I am stuck on this for a few days now. Please help. My ReactNative app crashes in TestFlight but seems to work...
Read more >
Troubleshooting for React Native | Sentry Documentation
Troubleshoot and resolve common issues with the React Native SDK.
Read more >
React Native: How to Fix IOS App Crashes
First of all, we try to find a crash report in Xcode. Navigate to Xcode->Window->Devices and Simulators open it. Attach your iPhone with...
Read more >
React-native - iOS device crashes "undefined is not an object ...
Turns out that running the following command fixes the issue. react-native bundle --entry-file ./index.js --platform ios --bundle-output ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found