diff --git a/src/pages/500.tsx b/src/pages/500.tsx index 728e7266..af2f0135 100644 --- a/src/pages/500.tsx +++ b/src/pages/500.tsx @@ -6,7 +6,7 @@ import PageContainer from '../components/PageContainer'; import { pages } from '../util/constants'; -export default ({ reqId }: { reqId: string }) => ( +export default ({ reqId, isTimeout }: { reqId: string; isTimeout?: boolean }) => ( <>
@@ -14,9 +14,15 @@ export default ({ reqId }: { reqId: string }) => (

Oops, the package failed to install.

- This can happen when there is no prebuilt binary for node@ - {process.versions.node} or the install script requires CLIs like - python/curl/etc. + {isTimeout ? ( + 'This can happen when the package took too long to install and the request timed out.' + ) : ( + <> + This can happen when there is no prebuilt binary for node@ + {process.versions.node} or the install script requires CLIs like + python/curl/etc. + + )}

Go Home diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index 1d7e64eb..d4d2f87a 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -253,8 +253,10 @@ async function routePage( if (err instanceof NotFoundError) { return ; } + const isTimeout = + err instanceof Error && 'code' in err && (err as any).code === 'ABORT_ERR'; console.error('Unexpected Error Occurred...', err); - return ; + return ; } }