-
-
Notifications
You must be signed in to change notification settings - Fork 353
Description
I noticed this while trying to debug an extremely rare error. I set up a custom error object with some serializable properties a few months ago.
Finally the error triggered today - but alas! The custom properties have not been captured in Sentry!
After some investigation I see that I need to set up extraErrorDataIntegration
:
https://docs.sentry.io/platforms/javascript/configuration/integrations/extraerrordata/
But this is not exported from @sentry/react-native
. Has it been deprecated or is this a bug?
I can install @sentry/core
myself and import it from there, but I get a type mismatch.
What React Native libraries do you use?
Expo Router, Expo Web, Expo (mobile only), Expo Application Services (EAS), RN New Architecture, React Navigation
Are you using sentry.io or on-premise?
sentry.io (SaS)
@sentry/react-native SDK Version
6.10.0
How does your development environment look like?
I'm using Expo purely with EAS builds so npx react-native@latest info
is not really relevant.
Packages:
All dependencies are pinned to Expo via npx expo-doctor
.
Sentry.init()
import * as Sentry from '@sentry/react-native';
const routingInstrumentation = Sentry.reactNavigationIntegration();
// This is undefined!
// const extraErrorData = Sentry.extraErrorDataIntegration();
Sentry.init({
dsn: 'https://[email protected]/...',
debug: false,
integrations: [routingInstrumentation], // I want to add extraDataErrorIntegration to this array
tracesSampleRate: 0.1,
});
Steps to Reproduce
- Install the latest version of
@sentry/react-native
- Write the following snippet in any file
import * as Sentry from '@sentry/react-native';
// This is undefined!
const extraErrorData = Sentry.extraErrorDataIntegration();
- Observe the typescript error
Property 'extraErrorDataIntegration' does not exist on type 'typeof import("/path/to/project/node_modules/@sentry/react-native/dist/js/index")'.ts(2339)
Expected Result
import * as Sentry from '@sentry/react-native';
const routingInstrumentation = Sentry.reactNavigationIntegration();
const extraErrorData = Sentry.extraErrorDataIntegration();
Sentry.init({
dsn: 'https://[email protected]/...',
debug: false,
integrations: [routingInstrumentation, extraErrorData],
tracesSampleRate: 0.1,
});
Actual Result
Property 'extraErrorDataIntegration' does not exist on type 'typeof import("/path/to/project/node_modules/@sentry/react-native/dist/js/index")'.ts(2339)
Metadata
Metadata
Assignees
Labels
Projects
Status
Status