diff --git a/packages/common/hooks/useDocsSearchV2.ts b/packages/common/hooks/useDocsSearchV2.ts index 5ea4c5171b5..ce15eb748c6 100644 --- a/packages/common/hooks/useDocsSearchV2.ts +++ b/packages/common/hooks/useDocsSearchV2.ts @@ -38,7 +38,8 @@ function reshapeResult(row: unknown): DocsSearchV2Result | null { const slug = row.slug as string return { id: `${slug}#${row.heading as string}`, - path: slug ? `/docs/${slug}` : '/docs', + // Next's router already prepends the app's basePath ('/docs'), so don't add it here. + path: slug ? `/${slug}` : '/', title: row.page_title as string, heading: row.heading as string, excerpt: row.excerpt as string,