sentry-expo ReactNativeTracing integration breaking

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): Android

sentry-expo: 3.1.3

I’ve been using sentry-expo for crash reporting and it’s been working great. Now I’m planning to setup Performace monitoring. After reading Sentry docs, I needed to update the sentry-expo from 3.0.4 to 3.1.3.
After the update, crash reporting still works as before. Issue is when i add “integrations” key and add tracing ReactNativeTracing, i get this error:

TypeError: undefined is not a function (near '...(0, _tracing.registerRequestInstrumentation)...')

This error is located at:
    in App (created by ExpoRoot)
    in ExpoRoot (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)
- node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError
- node_modules/react-native/Libraries/LogBox/LogBox.js:59:8 in errorImpl
- node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error
- node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
- node_modules/@sentry/react/node_modules/@sentry/utils/dist/instrument.js:110:42 in <anonymous>
- node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
- node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
- node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:15257:32 in logCapturedError
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:15361:20 in logError
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:16597:12 in update.callback
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:7106:2 in callCallback
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:7127:20 in commitUpdateQueue
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:15801:25 in commitLifeCycles
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18744:22 in commitLayoutEffects
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:265:4 in invokeGuardedCallbackImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:476:2 in invokeGuardedCallback
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18483:29 in commitRootImpl
* [native code]:null in commitRootImpl
- node_modules/scheduler/cjs/scheduler.development.js:653:23 in unstable_runWithPriority
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:18317:17 in commitRoot
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:17697:12 in performSyncWorkOnRoot
* [native code]:null in performSyncWorkOnRoot
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5321:31 in runWithPriority$argument_1
- node_modules/scheduler/cjs/scheduler.development.js:653:23 in unstable_runWithPriority
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5316:21 in flushSyncCallbackQueueImpl
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:5304:28 in flushSyncCallbackQueue
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:17125:30 in scheduleUpdateOnFiber
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:20527:14 in updateContainer
- node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:21068:17 in render
- node_modules/react-native/Libraries/ReactNative/renderApplication.js:54:4 in renderApplication
- node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnables.appKey.run
- node_modules/react-native/Libraries/ReactNative/AppRegistry.js:213:4 in runApplication
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:416:4 in __callFunction
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:109:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:108:4 in callFunctionReturnFlushedQueue
* [native code]:null in callFunctionReturnFlushedQueue

The code I’m using:

Sentry.init({
    dsn: Constants.manifest.extra.sentryDsn,
    environment: releaseEnvironment,
    enableInExpoDevelopment: true,
    debug: false,
    tracesSampleRate: 1,
    integrations: [
      new Sentry.Native.ReactNativeTracing({
        tracingOrigins: ['dor.vps.dvtalent.com', /^\//, /^https:\/\//]
      })
    ]
  });

Removing the Tracing integration removes the error.
How do I get tracing integration to work?

Thanks!

wanted to link your issue- ReactNativeTracing integration breaking · Issue #1422 · getsentry/sentry-react-native · GitHub here as well

This doesn’t look a problem with sentry-expo, instead it seems like maybe you’re missing a dependency?

I followed the docs as they are so I’m not sure what I could be missing. I also removed node_modules and had a fresh install, still same issue.

I manually installed @sentry/tracing (it’s name is mentioned in the error) and the error disappeared. But I get another error when Sentry is try to do some logging:

TypeError: undefined is not an object (evaluating 'types_1.TransactionSamplingMethod.Rate')
- node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError
- node_modules/react-native/Libraries/LogBox/LogBox.js:59:8 in errorImpl
- node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error
- node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
- node_modules/@sentry/react/node_modules/@sentry/utils/dist/instrument.js:110:42 in <anonymous>
- node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
- node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
- node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
- node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:9:32 in ErrorUtils.setGlobalHandler$argument_0
- node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
- node_modules/regenerator-runtime/runtime.js:293:29 in invoke
- node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
- node_modules/regenerator-runtime/runtime.js:154:27 in invoke
- node_modules/regenerator-runtime/runtime.js:164:18 in PromiseImpl.resolve.then$argument_0
- node_modules/react-native/node_modules/promise/setimmediate/core.js:37:13 in tryCallOne
- node_modules/react-native/node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:130:14 in _callTimer
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:181:14 in _callImmediatesPass
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:441:30 in callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:387:6 in __callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:135:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:134:4 in flushedQueue
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

It seems like sentry-expo is missing dependencies that are needed for performance monitoring. Should I expect an update to this package?

It seems like sentry-expo is missing dependencies that are needed for performance monitoring

hm, what makes you say that? to me it looks like you’re missing the @sentry/types library

Well @sentry/tracing was missing till I added it manually. So that could be the case with other dependencies?
And I did also install @sentry/types but still that didn’t help.

sentry-expo doesn’t use any functionality from @sentry/tracing, so I don’t think it should be included. It may be included in @sentry/react-native though, but I’m not sure

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.