From 095a87dfbf926b65d4d21c344c815cec4f488a58 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Apr 2026 01:08:08 +0000 Subject: [PATCH] fix: use current location for canonical URL during SSR The canonical path selector read from `state.resolvedLocation`, which represents the previously resolved location and is undefined on the initial SSR render. That made every server-rendered page fall back to `/`, so blog posts (and every other route) emitted ``. Mobile share sheets that honor the canonical then shared the root URL instead of the actual post. Switch to `state.location`, which is always populated with the current requested location. https://claude.ai/code/session_01UdssKwjy5SkB6gbB9y6XZS --- src/routes/__root.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index 549afe55..54781360 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -185,7 +185,7 @@ function ShellComponent({ children }: { children: React.ReactNode }) { }, [isNavigating]) const canonicalPath = useRouterState({ - select: (s) => s.resolvedLocation?.pathname || '/', + select: (s) => s.location?.pathname || '/', }) const preferredCanonicalPath = getCanonicalPath(canonicalPath)