From 306499473b0d124b2515560534aaa08e1db29b7c Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 23 Nov 2026 03:27:33 +0900 Subject: [PATCH] Reload the document when retrying a stale route chunk --- src/components/DefaultCatchBoundary.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/DefaultCatchBoundary.tsx b/src/components/DefaultCatchBoundary.tsx index 5083603cd..ab80f95ec 100644 --- a/src/components/DefaultCatchBoundary.tsx +++ b/src/components/DefaultCatchBoundary.tsx @@ -9,7 +9,10 @@ import { import * as Sentry from '@sentry/tanstackstart-react' import { Button } from '~/ui' -import { reloadOnStaleAppError } from '~/utils/stale-app-reload' +import { + isStaleAppError, + reloadOnStaleAppError, +} from '~/utils/stale-app-reload' import { useEffect } from 'react' // type DefaultCatchBoundaryType = { @@ -21,6 +24,7 @@ import { useEffect } from 'react' export function DefaultCatchBoundary({ error }: ErrorComponentProps) { const router = useRouter() + const needsReload = isStaleAppError(error) useEffect(() => { if (reloadOnStaleAppError(error)) return @@ -47,10 +51,14 @@ export function DefaultCatchBoundary({ error }: ErrorComponentProps) { {isRoot ? (