File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,6 +87,14 @@ export function getRouter() {
8787 errorMessage . includes ( 'null is not an object' ) ||
8888 errorMessage . includes ( 'is not a function' )
8989
90+ // Check for specific Publift Fuse container errors that occur during race conditions
91+ // These errors happen when Fuse library tries to access DOM elements before they're ready
92+ // Pattern: "null is not an object (evaluating 'this.getContainer().ownerDocument')"
93+ const isFuseContainerError =
94+ errorMessage . includes ( 'getContainer' ) &&
95+ errorMessage . includes ( 'ownerDocument' ) &&
96+ errorMessage . includes ( 'null is not an object' )
97+
9098 if ( hasAdScriptFrame && hasExpectedErrorMessage ) {
9199 // Suppress the error - log to console in debug mode
92100 console . debug (
@@ -97,6 +105,16 @@ export function getRouter() {
97105 return null // Don't send to Sentry
98106 }
99107
108+ // Also suppress Fuse container errors even if they don't have ad script frames
109+ // (the error may be reported from the page context rather than the external script)
110+ if ( isFuseContainerError ) {
111+ console . debug (
112+ 'Suppressed Publift Fuse container error:' ,
113+ errorMessage ,
114+ )
115+ return null // Don't send to Sentry
116+ }
117+
100118 return event
101119 } ,
102120 } )
You can’t perform that action at this time.
0 commit comments