Skip to content
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

"Java exception was raised during method invocation" error after React navigation on Android OS with FacebookMobile brwoser #15065

Open
3 tasks done
eshelsil opened this issue Jan 19, 2025 · 1 comment
Labels
Package: react Issues related to the Sentry React SDK

Comments

@eshelsil
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

7.93.0

Framework Version

18.2.0

Link to Sentry event

https://carefam.sentry.io/issues/6213106599/events/1a108b7f986349929f9de9866abdcb10/

Reproduction Example/SDK Setup

function SentryController({ children }: { children: ReactNode }) {
    useEffect(() => {
        if (config.ENV === Env.Dev && !config.DEV_TEST_SENTRY_ON_DEV) {
            return;
        }
        const isInitialized = Sentry.getClient() !== undefined;
        if (isInitialized) {
            return;
        }
        Sentry.init({
            dsn: config.SENTRY_DSN,
            integrations: [
                Sentry.browserTracingIntegration(),
                Sentry.replayIntegration({
                    maskAllText: false,
                }),
            ],
            tracesSampleRate: config.ENV === Env.Dev ? 1.0 : 0.1,
            replaysSessionSampleRate: config.ENV === Env.Dev ? 0 : 0.5,
            replaysOnErrorSampleRate: config.ENV === Env.Dev ? 0 : 1.0,
            tracePropagationTargets: [
                'localhost',
                `https://${config.PROD_URL}`,
                `https://${config.STAGING_URL}`,
            ],
            environment: config.ENV,
        });
        Sentry.setTag('session', getSessionId());
    }, []);

    return (
        <Sentry.ErrorBoundary fallback={ErrorFallbackView}>
            {children}
        </Sentry.ErrorBoundary>
    );
}

Steps to Reproduce

  1. implement logic that uses react navigation immediately on page visit (based on localStorage for example)
  2. visit the page using Android Device with Facebook-Mobile browser
  3. most of the time it will trigger this issue ( at least in my usecase)

Expected Result

  • Triggering error should be visible on the Sentry Issue, instead of generic error raised by Sentry lib: "Java exception was raised during method invocation"
  • StackTrace should show the lines in code that have triggered the error (and not only Sentry lib code)

Actual Result

Getting multiple errors on Sentry.
Only on FacebookMobile browser on Andorid OS
The error is triggered from Sentry lib, so it is too generic to archive:

Issue Title:
Error
Object.init()

Error:
Java exception was raised during method invocation

StackTrace:
in Object.init at line 37:42346
In App
at line 37:40603
In App
../../node_modules/@sentry/browser/esm/helpers.js in sentryWrapped at line 97:17

  // Attempt to invoke user-land function
  // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
  //       means the sentry.javascript SDK caught an error invoking your application code. This
  //       is expected behavior and NOT indicative of a bug with sentry.javascript.
  return fn.apply(this, wrappedArguments);    ---> // executed line
} catch (ex) {
  ignoreNextOnError();
  withScope(scope => {
    scope.addEventProcessor(event => {

This error happens immediately after navigation (auto navigation triggered by business logic, not by user click).
The user UX is unaffected, so this is just noise that Sentry is creating for us, and no safe way to ignore it.

Any help here?
Did anyone experienced a similar issue?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 19, 2025
@github-actions github-actions bot added the Package: react Issues related to the Sentry React SDK label Jan 19, 2025
@andreiborza
Copy link
Member

Hello @eshelsil, thanks for filing this.

Unfortunately, we are not actively developing Sentry v7 anymore. You could try to ignore this error setting ignoreErrors, see https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-ignore-errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: react Issues related to the Sentry React SDK
Projects
Status: No status
Development

No branches or pull requests

2 participants