getsentry/sentry-react-native

Session Replay doesn't work with ReactNativeTracing

rjzheng opened this issue · 2 comments

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

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

SDK version: 5.33.1

react-native version: 0.73.6

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

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

Local development

Configuration:

(@sentry/react-native)

export const routingInstrumentation = new Sentry.ReactNavigationInstrumentation({
    enableTimeToInitialDisplay: true,
});

export const initSentry = () => {
    Sentry.init({
        dsn: sentryDSN,
        environment: name,

        // enable Spotlight for development (https://spotlightjs.com)
        enableSpotlight: __DEV__,

        integrations: [
            Sentry.mobileReplayIntegration({
                maskAllText: false,
                maskAllImages: false,
                maskAllVectors: false,
            }),
            new Sentry.ReactNativeTracing({ routingInstrumentation }),
        ],

        sampleRate: __DEV__ ? 1.0 : 0.1,
        tracesSampleRate: __DEV__ ? 1.0 : 0.1,
        _experiments: {
            // profilesSampleRate is relative to tracesSampleRate.
            profilesSampleRate: __DEV__ ? 1.0 : 0.1,
            replaysSessionSampleRate: 1.0,
            replaysOnErrorSampleRate: 1.0,
        },
    });
};

I have the following issue:
Getting error RNSentry.getCurrentReplayId is not a function (it is undefined) when using Sentry.mobileReplayIntegration and Sentry.ReactNativeTracing together. Automatic instrumentation doesn't work for me so I have to add the routingInstrumentation to manually set it up to work with @react-navigation/native: 6.1.18. However I get this error when I have both.
Image

Steps to reproduce:

  • Use both Sentry.mobileReplayIntegration and Sentry.ReactNativeTracing in Sentry.init
  • Get the error shown in the screenshot above on app load

Actual result:

See screenshot

Expected result:

Tracing and session replay both work properly

Did this get resolved? Running into the same issue.

@Baltais94 it went away after I upgraded sentry

"@sentry/react-native": "^5.33.1",