sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Crash when using ReactNativeNavigationInstrumentation

Open marcshilling opened this issue 1 year ago • 5 comments

OS:

  • [ ] Windows
  • [x] MacOS
  • [ ] Linux

Platform:

  • [x] iOS
  • [x] Android

SDK:

  • [x] @sentry/react-native (>= 1.0.0)
  • [ ] react-native-sentry (<= 0.43.2)

SDK version: 5.16.0

react-native version: 0.72.7

Are you using Expo?

  • [ ] Yes
  • [x] No

Are you using sentry.io or on-premise?

  • [x] sentry.io (SaaS)
  • [ ] on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

https://untappd.sentry.io/issues/4952330973/events/c558303f29ee483f8585a4d3aae02a43/

[Relevant] Configuration:

(@sentry/react-native)

tracesSampleRate: 1.0,
integrations: [
  new Sentry.ReactNativeTracing({
    routingInstrumentation:
      new Sentry.ReactNativeNavigationInstrumentation(Navigation),
  }),
],

I have the following issue:

Navigating to certain screens in my app causes the following exception to be thrown from react-native-reanimated, only when I have tracing enabled on Sentry:

Error: [Reanimated] Reading from `_value` directly is only possible on the UI runtime., js engine: hermes

If I lower tracesSampleRate, it becomes clear that the crash only occurs when the current session is being sampled. If I remove integrations key from my Sentry.init altogether, the crash cannot be reproduced. I've yet to identify what exactly is unique to these screens that cause the crash when they are pushed, but there's no issue without these traces.

Here's the redbox where you can see the error initiate from Sentry tracing: image

marcshilling avatar Feb 13 '24 19:02 marcshilling

Hi @marcshilling,

thank you for reporting this,

what version of React Native Navigation are you using?

Is it reproducible in simple examples like these https://wix.github.io/react-native-navigation/docs/advanced-navigation?

krystofwoldrich avatar Feb 14 '24 12:02 krystofwoldrich

@krystofwoldrich

react-native version: 0.72.7

I don't believe it would be reproducible in any sample apps, as the crash seems to be related to react-native-reanimated. Like I said, I've yet to narrow down what it is about these certain screens in my app that trigger this issue upon a Navigation push. Still, I would think a tracing/instrumentation library like Sentry should be compatible with whatever.

marcshilling avatar Feb 14 '24 14:02 marcshilling

@marcshilling Thank you, what version of react-native-navigation are you using?

krystofwoldrich avatar Feb 14 '24 14:02 krystofwoldrich

@krystofwoldrich [email protected]. Also [email protected] if that helps. I do not use reanimated directly on any of the screens that cause this crash, however I do have a component using reanimated that's mounted elsewhere in the Stack.

A basic description of my setup:

Tab bar app, launches to the Home tab/screen. The home screen has a couple carousels on it using react-native-reanimated-carousel. And it also has some buttons that trigger pushes to other screens. That's where I can consistently make the crash occur: I tap one of these buttons, it pushes the new screen, and then 1 or 2 seconds later the redbox/crash happens.

marcshilling avatar Feb 14 '24 15:02 marcshilling

@marcshilling Thank you for the information, we will try to reproduce the issue with our sample app so we can debug it.

krystofwoldrich avatar Feb 16 '24 13:02 krystofwoldrich

I was unable to reproduce any crashes with this setup. Could you confirm whether the issue persists in your project using react-native-reanimated version 3.3.0 and the latest version of Sentry React Native?

lucas-zimerman avatar Jun 14 '24 03:06 lucas-zimerman

Since we can't reproduce the issue I'm closing this. In case there is a new context or reproducible example, please, comment here and we can reopen it.

krystofwoldrich avatar Jun 21 '24 12:06 krystofwoldrich