File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/browser-utils/src/metrics Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 55 getCurrentScope ,
66 getRootSpan ,
77 htmlTreeAsString ,
8+ isBrowser ,
89 SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME ,
910 SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT ,
1011 SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE ,
@@ -160,9 +161,11 @@ export const _onInp: InstrumentationHandlerCallback = ({ metric }) => {
160161export function registerInpInteractionListener ( ) : void {
161162 // Listen for all interaction events that could contribute to INP
162163 const interactionEvents = Object . keys ( INP_ENTRY_MAP ) ;
163- interactionEvents . forEach ( eventType => {
164- WINDOW . addEventListener ( eventType , captureElementFromEvent , { capture : true , passive : true } ) ;
165- } ) ;
164+ if ( isBrowser ( ) ) {
165+ interactionEvents . forEach ( eventType => {
166+ WINDOW . addEventListener ( eventType , captureElementFromEvent , { capture : true , passive : true } ) ;
167+ } ) ;
168+ }
166169
167170 /**
168171 * Captures the element name from a DOM event and stores it in the ELEMENT_NAME_TIMESTAMP_MAP.
You can’t perform that action at this time.
0 commit comments