Skip to content

Breakpoint not work when enable ANR detection. #1029

@CurryYangxx

Description

@CurryYangxx

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Electron SDK Version

5.4.0

Electron Version

31.4.0

What platform are you using?

MacOS

Link to Sentry event

No response

Steps to Reproduce

  1. open anr when init
  // main
  Sentry.init({
    ...SENTRY_OPTIONS,
    transportOptions: {
      /**
       * Called before we attempt to send an envelope to Sentry.
       *
       * If this function returns false, `shouldStore` will be called to determine if the envelope should be stored.
       *
       * Default: () => true
       *
       * @param envelope The envelope that will be sent.
       * @returns Whether we should attempt to send the envelope
       */
      shouldSend: () => enabled,
    },
    integrations: [
      Sentry.anrIntegration({ captureStackTrace: true }),
    ],
  });

  // renderer
  Sentry.init({
    ...SENTRY_OPTIONS,
    // enable sentry tracing
    integrations: [Sentry.browserTracingIntegration()],
    // set 0.1 sample rate for traces, only send 10% of traces, and check whether the limit is exceeded
    // https://konghq.sentry.io/settings/billing/overview/?category=transactions
    tracesSampleRate: 0.1,
    anrDetection: {
      captureStackTrace: true,
    },
  });
  1. add debugger in jscode in renderer process
  2. open devtool and can not hit breakpoint
  3. after close anr option, if can stop at breakpoint

Expected Result

stop at breakpoint

Actual Result

can not stop at breakpoint

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions