import { ExternalLink } from 'lucide-react' import Link from 'next/link' import { useRouter } from 'next/router' import type { FallbackProps } from 'react-error-boundary' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui' import { WarningIcon } from 'ui-patterns/Icons/StatusIcons' export const ErrorBoundaryState = ({ error, resetErrorBoundary }: FallbackProps) => { const router = useRouter() const message = `Path name: ${router.pathname}\n\n${error.stack}` const isRemoveChildError = error.message.includes("Failed to execute 'removeChild' on 'Node'") return (

Application error: a client-side exception has occurred (see browser console for more information)

Error: {error.message}

{isRemoveChildError && ( This error might be caused by Google translate or third-party browser extensions You may try to avoid using Google translate or disable certain browser extensions to avoid running into the 'removeChild' on 'Node' error. )}
{/* [Joshen] For local and staging, allow us to escape the error boundary */} {/* We could actually investigate how to make this available on prod, but without being able to reliably test this, I'm not keen to do it now */} {process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod' ? ( ) : ( )}
) }