Skip to content

Commit f0b3e98

Browse files
iHiDclaude
andauthored
Filter non-actionable "removeChild" DOM errors from Sentry (#8451) (#8462)
The "NotFoundError: Failed to execute 'removeChild' on 'Node'" is thrown by third-party scripts (reCAPTCHA, blob-loaded widgets) when they try to clean up DOM nodes that React has already unmounted. These errors are not actionable and create noise in Sentry. Closes #8451 Closes #8455 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a32503a commit f0b3e98

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

app/javascript/utils/react-bootloader.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ if (process.env.SENTRY_DSN) {
7777
)
7878
if (isNetworkError) return null
7979

80+
// Drop non-actionable DOM removeChild errors (third-party scripts like reCAPTCHA
81+
// trying to clean up nodes that React has already unmounted)
82+
const isRemoveChildError = event.exception?.values?.some((ex) =>
83+
ex.value?.includes("Failed to execute 'removeChild' on 'Node'")
84+
)
85+
if (isRemoveChildError) return null
86+
8087
const tag = document.querySelector<HTMLMetaElement>(
8188
'meta[name="user-id"]'
8289
)

0 commit comments

Comments
 (0)