Files
70b78c2945 Skip client-side data-fetching after ssr error (#51377)
Fixes: #47978

When an error occurs in getInitialProps, the error page's
getInitialProps is run server-side and returned in `__NEXT_DATA__`.
Following, there's no need to re-run `getInitialProps` client-side on
the hydrate pass.

---------

Co-authored-by: JJ Kasper <[email protected]>
2024-02-07 17:24:26 -08:00

8 lines
131 B
TypeScript

export default function Page() {
return <p>hello world</p>
}
Page.getInitialProps = () => {
throw new Error('custom error')
}