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 @@ -17,7 +17,6 @@ import { WINDOW } from '../types';
17
17
import { getNavigationEntry } from '../web-vitals/lib/getNavigationEntry' ;
18
18
import { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher' ;
19
19
import type { NavigatorDeviceMemory , NavigatorNetworkInformation } from '../web-vitals/types' ;
20
- import type { TTFBMetric } from '../web-vitals/types/ttfb' ;
21
20
import { isMeasurementValue , startAndEndSpan } from './utils' ;
22
21
23
22
const MAX_INT_AS_BYTES = 2147483647 ;
@@ -541,7 +540,11 @@ function setResourceEntrySizeData(
541
540
* ttfb information is added via vendored web vitals library.
542
541
*/
543
542
function _addTtfbRequestTimeToMeasurements ( _measurements : Measurements ) : void {
544
- const navEntry = getNavigationEntry ( ) as TTFBMetric [ 'entries' ] [ number ] ;
543
+ const navEntry = getNavigationEntry ( ) ;
544
+ if ( ! navEntry ) {
545
+ return ;
546
+ }
547
+
545
548
const { responseStart, requestStart } = navEntry ;
546
549
547
550
if ( requestStart <= responseStart ) {
You can’t perform that action at this time.
0 commit comments