The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Error boundary handle removeChild error (#26580)
Joshen Lim429f3d28513e
diff --git a/apps/studio/components/ui/ErrorBoundaryState.tsx b/apps/studio/components/ui/ErrorBoundaryState.tsxindex 84b7a2524bb..54b8759c328 100644--- a/apps/studio/components/ui/ErrorBoundaryState.tsx+++ b/apps/studio/components/ui/ErrorBoundaryState.tsx@@ -3,11 +3,13 @@ import Link from 'next/link'import { useRouter } from 'next/router'import type { FallbackProps } from 'react-error-boundary'-import { Button } from 'ui'+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 (<div className="w-screen h-screen flex items-center justify-center flex-col gap-y-3">@@ -19,6 +21,30 @@ export const ErrorBoundaryState = ({ error, resetErrorBoundary }: FallbackProps)<p className="text-sm text-foreground-light">Error: {error.message}</p></div>+ {isRemoveChildError && (+ <Alert_Shadcn_ className="w-[650px]">+ <WarningIcon />+ <AlertTitle_Shadcn_>+ This error might be caused by Google translate or third-party browser extensions+ </AlertTitle_Shadcn_>+ <AlertDescription_Shadcn_>+ You may try to avoid using Google translate or disable certain browser extensions to+ avoid running into the <code className="text-xs">'removeChild' on 'Node'</code> error.+ </AlertDescription_Shadcn_>+ <AlertDescription_Shadcn_ className="mt-3">+ <Button asChild type="default" icon={<ExternalLink />}>+ <a+ target="_blank"+ rel="noreferrer"+ href="https://github.com/facebook/react/issues/17256"+ >+ More information+ </a>+ </Button>+ </AlertDescription_Shadcn_>+ </Alert_Shadcn_>+ )}+<div className="flex items-center justify-center gap-x-2"><Button asChild type="default" icon={<ExternalLink />}><Link@@ -30,10 +56,14 @@ export const ErrorBoundaryState = ({ error, resetErrorBoundary }: FallbackProps)</Button>{/* [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' && (+ {process.env.NEXT_PUBLIC_ENVIRONMENT !== 'prod' ? (<Button type="outline" onClick={() => resetErrorBoundary()}>Return to dashboard</Button>+ ) : (+ <Button type="outline" onClick={() => router.reload()}>+ Reload dashboard+ </Button>)}</div></div>