From 41f75eb9938df6b416bc7a15f8946adc3b9caa4d Mon Sep 17 00:00:00 2001 From: Alaister Young <10985857+alaister@users.noreply.github.com> Date: Fri, 8 May 2026 17:16:37 +0800 Subject: [PATCH] fix basePath prefix --- apps/studio/compat/next/router.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/studio/compat/next/router.ts b/apps/studio/compat/next/router.ts index 68cf051450c..01a9c72aa63 100644 --- a/apps/studio/compat/next/router.ts +++ b/apps/studio/compat/next/router.ts @@ -104,7 +104,11 @@ export function useRouter() { route: pathPattern, query: { ...params, ...search }, asPath: location.href, - basePath: router.basepath ?? '', + basePath: router.basepath + ? router.basepath.startsWith('/') + ? router.basepath + : `/${router.basepath}` + : '', // TanStack resolves params/search synchronously on render, so the // pages-router "is the dynamic param ready yet?" flag is always // true here. (In Next this can be false during the very first