Skip to content

Custom breadcrumbs don't show up in Replays #12162

@InterstellarStella

Description

@InterstellarStella

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

8.2.1

Framework Version

No response

Link to Sentry event

No response

SDK Setup

import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import * as Sentry from "@sentry/react";
import * as DOM from 'react-router-dom';

Sentry.init({
  dsn: "DSN_HERE",
  integrations: [
    // See docs for support of different versions of variation of react router
    // https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/
    Sentry.reactRouterV6BrowserTracingIntegration({
      useEffect: React.useEffect,
      useLocation: DOM.useLocation,
      useNavigationType: DOM.useNavigationType,
      createRoutesFromChildren: DOM.createRoutesFromChildren,
      matchRoutes: DOM.matchRoutes
    }),
    Sentry.replayIntegration()
  ],

  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for performance monitoring.
  tracesSampleRate: 1.0,

  // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
  tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],

  // Capture Replay for 10% of all sessions,
  // plus for 100% of sessions with an error
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

Steps to Reproduce

<button
          type="button"
          onClick={() => {
            Sentry.addBreadcrumb({
              "type": "default",
              "category": "started",
              "data": undefined,
              "level": "info",
              "message": "this is a message",
            });

            throw new Error('Sentry Test Error');
          }}
        >
          Break the world
        </button>

Expected Result

The breadcrumb shows up both in the issue and in the replay.

Actual Result

The breadcrumb shows up only in the issue and not in the replay.

Issue:
image

Replay:
image

Here is the event for reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: reactIssues related to the Sentry React SDKPackage: replayIssues related to the Sentry Replay SDK

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions