Files
Joshen Lim 6d08d66b7d Add eslint rule for google translate dynamic spans + address all issues (#52949)
## Context

We've been seeing many `NotFoundError: Failed to execute 'removeChild'
on 'Node'` and `NotFoundError: Failed to execute 'insertBefore' on
'Node'` events on Sentry which are historically known to be caused by
Google Translate in the browser.

There's technically no _right way_ to address this unfortunately, but
one of the solutions which should address most of these issues is to
wrap any dynamic text within a span - we've considered that quite a
while back tbh but never took the time to do this until today with the
help of Claude. Although just a heads up that it might not necessarily
completely eradicate those issues.

Also added an eslint rule which should prevent future occurences of this
<img width="1264" height="192" alt="image"
src="https://github.com/user-attachments/assets/b2c32ea0-45a2-4ccd-82fe-1a859905fc29"
/>
2026-11-05 23:28:46 +08:00

51 lines
1.5 KiB
TypeScript

import { SupportCategories } from '@supabase/shared-types/out/constants'
import { useParams } from 'common'
import { Button } from 'ui'
import { Admonition } from 'ui-patterns/Admonition'
import { SupportLink } from '../Support/SupportLink'
import type { StudioError } from '@/lib/errors/studio-errors'
export interface StorageBucketsErrorProps {
error: StudioError
}
const StorageBucketsError = ({ error }: StorageBucketsErrorProps) => {
const { ref } = useParams()
return (
<div className="storage-container flex items-center justify-center grow">
<div>
<Admonition
type="warning"
layout="horizontal"
title="Failed to fetch buckets"
description={
<>
<p className="mb-1">
Please try refreshing your browser, or contact support if the issue persists
</p>
<p>Error: {(error as any)?.message ?? <span>Unknown</span>}</p>
</>
}
actions={
<Button key="contact-support" asChild className="ml-4">
<SupportLink
queryParams={{
projectRef: ref,
category: SupportCategories.DASHBOARD_BUG,
subject: 'Unable to fetch storage buckets',
}}
>
Contact support
</SupportLink>
</Button>
}
/>
</div>
</div>
)
}
export default StorageBucketsError