GoogleChrome / GoogleChrome/web-vitals

reportAllChanges throws TypeError: Cannot read properties of undefined (reading 'startTime')

Open
#792 7 comments 16 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8.6k
Forks
530
Avg merge
3h 4m
Merged PRs (30d)
3

Description

## Description

Chrome DevTools throws an uncaught `TypeError` from its embedded copy of `web-vitals` during client-side (soft) navigations.

The stack is entirely in an anonymous `VM*` script injected by Chrome DevTools (`et.reportAllChanges` → `n.timeout`). There are no application frames. The bytecode offsets match this report:

- https://github.com/angular/angular/issues/70464

That issue was filed against Angular, but the same crash also happens in other SPAs that do not use Angular and do not import `web-vitals`. It only appears in Chrome with DevTools open.

This looks like a missing null check in `reportAllChanges` when a performance entry has already been cleared or reset after a soft navigation, then processed later via `setTimeout` / idle callback.

Related:

- https://github.com/GoogleChrome/web-vitals/issues/274
- https://github.com/GoogleChrome/web-vitals/issues/669
- https://github.com/GoogleChrome/web-vitals/pull/758

If the crashing code is the DevTools-bundled build rather than an app-installed package, a fix here would still need to land in Chromium DevTools.

## Expected

`reportAllChanges` should skip missing entries and never throw.

## Actual

Uncaught TypeError: Cannot read properties of undefined (reading 'startTime') at et.reportAllChanges (:2:19429) at :2:13070 at :2:331 at d (:2:6141) at u (:2:6153) at :2:6321 at :2:2895 at n.timeout (:2:5652)

Offsets `:2:19429` (`reportAllChanges`) and `:2:5652` (`n.timeout`) are identical to https://github.com/angular/angular/issues/70464.

Contributor guide

Open the contributing guide

Research direction

Start at the reportAllChanges entry point and inspect how performance entries are processed after soft navigation and delayed callbacks. Reproduce the missing-entry case described in the issue, then verify that reportAllChanges skips it without throwing; confirm whether the fix belongs in this package or Chromium DevTools.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.