Skip to content

_addTtfbRequestTimeToMeasurements throws TypeError: undefined is not an object (evaluating 't.responseStart') #11310

Closed

Description

@ilmarivacklinsc

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

7.108.0

Framework Version

17.0.2

Link to Sentry event

https://supercell.sentry.io/issues/5105529056/events/84972ab28bc94b619f11d795c70f2bfe/?project=4504167659208704

SDK Setup

Sentry.init({
    maxValueLength: 3000,
    environment: buildInfo.environmentName,
    release: buildInfo.buildId,
    integrations: [
        browserTracingIntegration(),
        reactRouterV6BrowserTracingIntegration({
            useEffect,
            useLocation,
            useNavigationType,
            createRoutesFromChildren,
            matchRoutes,
        }),
        extraErrorDataIntegration(),
    ],
    tracesSampleRate: 0.1,
    sampleRate: 0.1,
    ...opts,
});

(opts includes the DSN)

Steps to Reproduce

Just used the web page. Note that this is coming from an iOS WKWebView.

Expected Result

The type of getNavigationEntry says it can return undefined, but _addTtfbRequestTimeToMeasurements doesn't check for this. I think this line should be changed:

const navEntry = getNavigationEntry() as TTFBMetric['entries'][number];

Actual Result

No accessing undefined.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Mar 27, 2024
  2. AbhiPrasad commented on Mar 27, 2024

    @AbhiPrasad
    Contributor

    @ilmarivacklinsc good catch - we shouldn't be casting here. Opened fix with #11311

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Mar 27, 2024
  4. self-assigned this
    on Mar 27, 2024
  5. AbhiPrasad commented on Mar 28, 2024

    @AbhiPrasad
    Contributor
  6. ghost added on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions