Skip to content

fix(replays): Guard against undefined frame.data in BreadcrumbWebVital - #124990

Open
sentry[bot] wants to merge 3 commits into
masterfrom
seer/fix/replays-undefined-web-vital-data
Open

sentry[bot] wants to merge 3 commits into
masterfrom
seer/fix/replays-undefined-web-vital-data

Conversation

@sentry

@sentry sentry Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a TypeError: Cannot read properties of undefined (reading 'value') occurring in the BreadcrumbWebVital component.

Root Cause:
The BreadcrumbWebVital component attempts to access frame.data.value without ensuring frame.data is defined. While isWebVitalFrame checks the frame's op property, it does not guarantee the presence of the data field. Older replay SDK versions (specifically < 8.22.0) can produce web-vital span frames where the data field is entirely absent, leading to a runtime error when these frames are processed.

Fix:
Added a null guard (if (!frame.data) return null;) in static/app/components/replays/breadcrumbs/breadcrumbWebVital.tsx immediately after the isWebVitalFrame check. This ensures that the component gracefully handles frames with missing data by not rendering, preventing the TypeError.

Test:
Added a new test file static/app/components/replays/breadcrumbs/breadcrumbWebVital.spec.tsx with two test cases:

  1. Verifies that the component renders nothing when frame.data is undefined (simulating the problematic legacy frames).
  2. Verifies that the component renders correctly when frame.data is present.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes JAVASCRIPT-3B62

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@sentry
sentry Bot requested a review from a team as a code owner September 18, 2026 22:48
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants