Skip to content

[@sentry-internal/browser-utils]: Cannot read properties of null (reading 'apply') #15552

Closed
@TheDevMinerTV

Description

@TheDevMinerTV

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/angular

SDK Version

9.2.0

Framework Version

19.1.7

Link to Sentry event

https://legartis.sentry.io/issues/31731207

Reproduction Example/SDK Setup

Sentry.init({
  dsn,
  tracePropagationTargets: [ /* OUR SERVICES */ ],
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.replayIntegration(),
  ],
  tracesSampleRate: sentryConfig.tracesRate,
  environment: sentryConfig.environment,
  release: sentryConfig.release,
  debug: sentryConfig.debug,
});

Steps to Reproduce

Not sure, a customer triggered the internal Sentry error

Expected Result

This shouldn't happen

Actual Result

Cannot read properties of null (reading 'apply')

node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js in History.replaceState:58

...
          from,
          to
        };
        triggerHandlers('history', handlerData);
      }
      return originalHistoryFunction.apply(this, args);
      //     ^^^^^^^^^^^^^^^^^^^^^^^
    };
  }
  fill(WINDOW.history, 'pushState', historyReplacementFunction);
  fill(WINDOW.history, 'replaceState', historyReplacementFunction);
}
...

Metadata

Metadata

Assignees

Labels

Package: angularIssues related to the Sentry Angular SDK

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions