diff --git a/src/onINP.ts b/src/onINP.ts index cf857de5..ac23c2fe 100644 --- a/src/onINP.ts +++ b/src/onINP.ts @@ -220,7 +220,10 @@ export const onINP = (onReport: INPReportCallback, opts?: ReportOpts) => { // If browser supports interactionId (and so supports INP), also // observe entries of type `first-input`. This is useful in cases // where the first interaction is less than the `durationThreshold`. - if ('interactionId' in PerformanceEventTiming.prototype) { + if ( + 'PerformanceEventTiming' in window && + 'interactionId' in PerformanceEventTiming.prototype + ) { po.observe({type: 'first-input', buffered: true}); }