iosxcodereact-nativesentry

React native sentry Use of undeclared identifier 'kSentryLevelWarning'


I'm using @sentry/react-native version 5.18.0 in my React Native project and I'm getting the errors "Use of undeclared identifier 'kSentryLevelFatal'" and "Use of undeclared identifier 'kSentryLevelWarning'". My dependencies include axios 1.4.0, moment 2.29.4, react 18.2.0, and react-native 0.72.8. These errors occur when I try to configure Sentry levels. How can I resolve these errors? Is there a new way to set Sentry levels in the latest version?

There is open PR also in the https://github.com/getsentry/sentry-react-native/issues/3863

enter image description here


Solution

  • You can use @sentry/react-native: '5.20.0'. It will resolve your error.