Skip to content

Commit b059308

Browse files
committed
chore: prevent page from throwing client error
1 parent f4a29db commit b059308

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/website/components/site/hero.section.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Stack,
1212
Tabs,
1313
} from '@chakra-ui/react'
14+
import { ErrorBoundary } from 'next/dist/client/components/error-boundary'
1415
import dynamic from 'next/dynamic'
1516
import Link from 'next/link'
1617
import { HiArrowRight } from 'react-icons/hi'
@@ -40,14 +41,20 @@ const ComponentDemos = () => {
4041
position="relative"
4142
>
4243
<Tabs.Content value="crm" height="100%" p="0">
43-
<CRMDemo />
44+
<ErrorBoundary errorComponent={ErrorFallback}>
45+
<CRMDemo />
46+
</ErrorBoundary>
4447
</Tabs.Content>
4548
</Tabs.ContentGroup>
4649
</Tabs.Root>
4750
</Container>
4851
)
4952
}
5053

54+
function ErrorFallback(props: { error: Error }) {
55+
return <div>Error</div>
56+
}
57+
5158
export const HeroSection = () => (
5259
<Box px="8">
5360
<Box pt="32" overflow="hidden" position="relative">

0 commit comments

Comments
 (0)