Skip to content

@sentry/react error boundary eventId does not match event id in the Sentry #4534

@cameronmcefee

Description

@cameronmcefee

Package + Version

  • "@sentry/react": "^6.17.6",
  • "@sentry/tracing": "^6.17.6",

Version:

6.17.6

Description

In the following example, I'm trying to get the id of the event that is captured, so that it will be available to the user that experiences the error to send in a support ticket. However, if I then go search sentry for event.id: <the event id> I can't find the event, and if I track it down manually, the event's ID is not the same.

Is this a bug or do I not understanding what eventId is for?

const MyComponent = () => {
  const [msg, setMsg] = React.useState("Works");

  return (
    <Sentry.ErrorBoundary
      fallback={({ eventId }) => {
        return <p>Search Sentry for <code>event.id: {eventId}</code></p>;
      }}
    >
      <div>{msg}</div>
      <button
        onClick={() => {
          setMsg({ message: "This will break" });
        }}
      >
        Click to trigger error
      </button>
    </Sentry.ErrorBoundary>
  );
};

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions