mirror of
https://github.com/supabase/supabase.git
synced 2026-12-05 16:09:06 +00:00
In the TanStack build, links from the dashboard to other pages on the same origin (e.g. `https://supabase.com/docs/...` from `/dashboard`) were treated as internal routes and got the basepath prepended, landing on `/dashboard/docs/...`. Next only treats an absolute URL as local when it's same-origin **and** under the basePath, so this matches that behavior. **Changed:** - `splitInternalUrl` leaves absolute same-origin URLs outside `NEXT_PUBLIC_BASE_PATH` untouched, so the `next/link` shim renders a plain anchor. Relative paths are always internal, and nothing changes when no basePath is set - The `next/router` shim's `push`/`replace` now do a document navigation for absolute external targets. Previously TanStack resolved an absolute `to` as a relative path segment, so `router.push` to any external URL (cross-origin too) stayed inside the app - `prefetch` skips external targets **Added:** - Unit tests for `splitInternalUrl`, plus shim tests rendering the real Link/router under a `/dashboard` basepath ## To test - Only reproducible where docs and the dashboard share an origin (i.e. prod `supabase.com/dashboard`). On previews, confirm nothing regressed: - New project → pick a paid compute size on a Pro org → submit → in "Confirm compute costs", the "Compute Costs" link opens the compute docs in a new tab - Click a few other docs links (e.g. in project settings) – they open the docs, not a dashboard 404 - Normal in-app navigation (sidebar, table editor links) still navigates client-side without full reloads --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>