import type { ErrorComponentProps } from "@tanstack/react-router"; import { TriangleAlert } from "lucide-react"; const FALLBACK_MESSAGE = "An unexpected error occurred. Try reloading the page."; function errorMessage(error: unknown): string { if (error instanceof Error && error.message) return error.message; if (typeof error === "string" && error) return error; return FALLBACK_MESSAGE; } export function AppErrorComponent({ error }: ErrorComponentProps) { return (

Something went wrong

{errorMessage(error)}

); }