diff --git a/app/error-route-test/page.tsx b/app/error-route-test/page.tsx new file mode 100644 index 00000000..febdf090 --- /dev/null +++ b/app/error-route-test/page.tsx @@ -0,0 +1,8 @@ +'use client'; + +export default function Page() { + setTimeout(() => { + throw new Error('An Error'); + }, 1000); + return
ERROR TESTING PAGE
; +} diff --git a/app/layout.tsx b/app/layout.tsx index 0c15970e..d61aa7b3 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,4 +1,5 @@ import GoogleTagManagerScript from '../components/head/GoogleTagManagerScript'; +import ErrorBoundary from '../components/layout/ErrorBoundary'; import rootMetadata from './rootMetadata'; import RollbarScript from '../components/head/RollbarScript'; @@ -20,7 +21,7 @@ export default function RootLayout({ */} - {children} + {children} ); diff --git a/components/layout/ErrorBoundary.tsx b/components/layout/ErrorBoundary.tsx index c744219e..adbcdffb 100644 --- a/components/layout/ErrorBoundary.tsx +++ b/components/layout/ErrorBoundary.tsx @@ -1,3 +1,5 @@ +'use client'; + import { Alert, Snackbar } from '@mui/material'; import { Component, ErrorInfo, ReactNode } from 'react';