diff --git a/apps/web/src/routes/__root.tsx b/apps/web/src/routes/__root.tsx index 0831a922325e..02e309dd783f 100644 --- a/apps/web/src/routes/__root.tsx +++ b/apps/web/src/routes/__root.tsx @@ -8,6 +8,7 @@ import { type ErrorComponentProps, useLocation, useNavigate, + useRouter, } from "@tanstack/react-router"; import { CheckIcon, CopyIcon } from "lucide-react"; import { useEffect, useEffectEvent, useMemo, useRef, useState } from "react"; @@ -336,7 +337,8 @@ function HostedStaticEnvironmentBootstrap() { return null; } -function RootRouteErrorView({ error, reset }: ErrorComponentProps) { +function RootRouteErrorView({ error }: ErrorComponentProps) { + const router = useRouter(); const message = errorMessage(error); // Router pathname rather than window.location: desktop uses hash history, where the window path is always "/". const pathname = useLocation({ select: (location) => location.pathname }); @@ -359,7 +361,7 @@ function RootRouteErrorView({ error, reset }: ErrorComponentProps) {
{message}