File tree 1 file changed +5
-2
lines changed
packages/tracing-internal/src/browser/metrics
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';
32
32
33
33
import { createSpanEnvelope } from '@sentry/core' ;
34
34
import { getNavigationEntry } from '../web-vitals/lib/getNavigationEntry' ;
35
- import type { TTFBMetric } from '../web-vitals/types/ttfb' ;
36
35
37
36
const MAX_INT_AS_BYTES = 2147483647 ;
38
37
@@ -674,7 +673,11 @@ function setResourceEntrySizeData(
674
673
* ttfb information is added via vendored web vitals library.
675
674
*/
676
675
function _addTtfbRequestTimeToMeasurements ( _measurements : Measurements ) : void {
677
- const navEntry = getNavigationEntry ( ) as TTFBMetric [ 'entries' ] [ number ] ;
676
+ const navEntry = getNavigationEntry ( ) ;
677
+ if ( ! navEntry ) {
678
+ return ;
679
+ }
680
+
678
681
const { responseStart, requestStart } = navEntry ;
679
682
680
683
if ( requestStart <= responseStart ) {
You can’t perform that action at this time.
0 commit comments