File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/tracing-internal/src/browser/metrics Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ import { _startChild, isMeasurementValue } from './utils';
3232
3333import { createSpanEnvelope } from '@sentry/core' ;
3434import { getNavigationEntry } from '../web-vitals/lib/getNavigationEntry' ;
35- import type { TTFBMetric } from '../web-vitals/types/ttfb' ;
3635
3736const MAX_INT_AS_BYTES = 2147483647 ;
3837
@@ -674,7 +673,11 @@ function setResourceEntrySizeData(
674673 * ttfb information is added via vendored web vitals library.
675674 */
676675function _addTtfbRequestTimeToMeasurements ( _measurements : Measurements ) : void {
677- const navEntry = getNavigationEntry ( ) as TTFBMetric [ 'entries' ] [ number ] ;
676+ const navEntry = getNavigationEntry ( ) ;
677+ if ( ! navEntry ) {
678+ return ;
679+ }
680+
678681 const { responseStart, requestStart } = navEntry ;
679682
680683 if ( requestStart <= responseStart ) {
You can’t perform that action at this time.
0 commit comments