Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ export function getRouter() {
errorMessage.includes('null is not an object') ||
errorMessage.includes('is not a function')

// Check for specific Publift Fuse container errors that occur during race conditions
// These errors happen when Fuse library tries to access DOM elements before they're ready
// Pattern: "null is not an object (evaluating 'this.getContainer().ownerDocument')"
const isFuseContainerError =
errorMessage.includes('getContainer') &&
errorMessage.includes('ownerDocument') &&
errorMessage.includes('null is not an object')

if (hasAdScriptFrame && hasExpectedErrorMessage) {
// Suppress the error - log to console in debug mode
console.debug(
Expand All @@ -97,6 +105,16 @@ export function getRouter() {
return null // Don't send to Sentry
}

// Also suppress Fuse container errors even if they don't have ad script frames
// (the error may be reported from the page context rather than the external script)
if (isFuseContainerError) {
console.debug(
'Suppressed Publift Fuse container error:',
errorMessage,
)
return null // Don't send to Sentry
}

return event
},
})
Expand Down