Skip to content

Cannot assign to read only property 'debug' of object '#<Object>' #14368

Closed
@egorshar

Description

@egorshar

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/react

SDK Version

8.30.0

Framework Version

18.2.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

initSentry({
  ...runtimeConfig.sentry,
  allowUrls: [
    document.location.origin,
    ...(appSettings.themeBuild.assetPrefix ? [appSettings.themeBuild.assetPrefix] : []),
  ],
  environment: runtimeConfig.env,
  integrations: [
    reactRouterV6BrowserTracingIntegration({
      stripBasename: true,
      useEffect,
      useLocation,
      useNavigationType,
      createRoutesFromChildren,
      matchRoutes,
    }),
    replayIntegration(),
    httpClientIntegration(),
  ],
  tracesSampleRate: 1.0,
  tracePropagationTargets: ['localhost', API_REGEXP],
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

Steps to Reproduce

In exceptions reported by our clients, we observe an error where Sentry’s breadcrumbs integration seems to overwrite the console.debug method, but the method is unexpectedly readonly. This issue occurs before the full initialization of the Sentry client, and as a result, the events are not enriched with even basic browser metadata. Despite searching for similar issues, no solutions or explanations have been found online.

Do you have any insights into what might cause this or suggestions on how best to handle this case?

Expected Result

No error should be thrown

Actual Result

TypeError
Cannot assign to read only property 'debug' of object '#'

Image

Metadata

Metadata

Assignees

Labels

Package: reactIssues related to the Sentry React SDK

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions