You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS crash -[SentryLog count]: unrecognized selector when beforeSendLog is set and the native SDK emits a log #6842
Emit a log from the native side, e.g. from a native module in Swift: SentrySDK.logger.info("hello")
The app crashes as soon as the native logger processes the log.
Actual result
*** Terminating app due to uncaught exception 'RCTFatalException: NSException:
-[Sentry.SentryLog count]: unrecognized selector sent to instance 0x126189400
...
React facebook::react::TurboModuleConvertUtils::convertJSIFunctionToCallback(...)
React facebook::react::AsyncCallback<>::callWithFunction(...)
Expected result
No crash. The native log is sent, or at least ignored by the JS beforeSendLog.
Cause
NATIVE.initNativeSdk in packages/core/src/js/wrapper.ts strips the callbacks that native cannot run: beforeSend, beforeBreadcrumb, beforeSendTransaction and beforeSendMetric. It doesn't strip beforeSendLog (nor beforeSendSpan). So the JS function crosses the bridge as an RCTResponseSenderBlock, which takes an NSArray *. sentry-cocoa 9 reads beforeSendLog from the options dictionary and calls the block with a SentryLog, and the block calls -count on it.
Suggested fix
Add beforeSendLog and beforeSendSpan to the destructured and stripped keys in initNativeSdk. We applied that with patch-package, and the crash is gone:
Activity
linear-code commentedon Oct 5, 2026
RN-811
alwx commentedon Oct 6, 2026
Thanks for reporting. We've seen your request and added it to our triage queue.
We'll review it shortly and follow up if we need more information or once next steps are clearer.
fix(core): Strip callback options before the native SDK starts
fix(core): Strip callback options before the native SDK starts (#6847)
github-actions commentedon Oct 8, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #6847, which was included in the 8.30.0 release.