-
-
Notifications
You must be signed in to change notification settings - Fork 344
Unhandled JS Errors has duplication report with manual initialization the native SDKs #4649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @jHolub, Please add the following on Android side sentry-react-native/packages/core/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java Lines 304 to 307 in f8289de
sentry-react-native/packages/core/ios/RNSentry.mm Lines 140 to 146 in f8289de
Let us know if this works for you. PS: The reporting of unhandled JS errors will be handled out of the box when #3608 is released. |
@krystofwoldrich Thank you for the response, but the version 6.9.1 already contains the above code. The error only occurs when the package is setup manually. If the package is initialized only in the JS layer, everything is fine, but this method is not preferred by us. |
Yes, the 6.9.1 contains the mentioned code, but it's only executed when using the automatic initialization of the native layers from JS. If you manually initialize the Android and Cocoa SDKs, add the mentioned code to your init to avoid the duplicates. |
What React Native libraries do you use?
Hermes, React Native Navigation by Wix, React Native without Frameworks
Are you using sentry.io or on-premise?
sentry.io (SaS)
@sentry/react-native SDK Version
6.9.1
How does your development environment look like?
System:
OS: macOS 14.6.1
CPU: (12) arm64 Apple M3 Pro
Memory: 2.22 GB / 36.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.16.0
path: ~/.nvm/versions/node/v18.16.0/bin/node
Yarn:
version: 4.3.1
path: ~/.nvm/versions/node/v18.16.0/bin/yarn
npm:
version: 9.5.1
path: ~/.nvm/versions/node/v18.16.0/bin/npm
Watchman:
version: 2024.12.02.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /Users/jiriholub/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK: Not Found
IDEs:
Android Studio: 2024.1 AI-241.18034.62.2412.12266719
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.12
path: /usr/bin/javac
Ruby:
version: 3.1.6
path: /Users/jiriholub/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.1.3
wanted: 15.1.3
react: Not Found
react-native:
installed: 0.76.7
wanted: 0.76.7
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Sentry.init()
Sentry.init({
dsn: "...",
autoInitializeNativeSdk: false,
enabled: enableErrorReporting,
enableNative: enableErrorReporting,
environment: environment,
integrations: [
Sentry.reactNativeNavigationIntegration({
navigation: Navigation,
}),
],
});
in native part:
Steps to Reproduce
Make release build application and then create unhandled javascript error (e.g.: throw new Error()).
After restart application due to crash is reporting the error twice in sentry.io.
Expected Result
The error is reported only once after application crashing.
Actual Result
After restart application due to crash by unhandled javascript error is reporting the error twice in sentry.io.
The text was updated successfully, but these errors were encountered: