From 09a1c233d51fb403ad523467d0a3aff4b14e381f Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Fri, 8 May 2026 11:24:56 +0530 Subject: [PATCH] fix(docs): respect basePath in static search index URL Fumadocs' static Orama client hardcodes /api/search and ignores Next's basePath, so on the github.io/taskito deploy the fetch 404s, the rejected promise is cached, and the dialog renders empty (no "no results" text). Expose basePath as NEXT_PUBLIC_DOCS_BASE_PATH and pass it via from. --- docs/next.config.mjs | 3 +++ docs/src/components/search.tsx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/next.config.mjs b/docs/next.config.mjs index 07bd088..bf33f76 100644 --- a/docs/next.config.mjs +++ b/docs/next.config.mjs @@ -15,6 +15,9 @@ const config = { images: { unoptimized: true, }, + env: { + NEXT_PUBLIC_DOCS_BASE_PATH: basePath, + }, }; export default withMDX(config); diff --git a/docs/src/components/search.tsx b/docs/src/components/search.tsx index c46e11e..3b2dc8a 100644 --- a/docs/src/components/search.tsx +++ b/docs/src/components/search.tsx @@ -22,12 +22,15 @@ function initOrama() { }); } +const basePath = process.env.NEXT_PUBLIC_DOCS_BASE_PATH ?? ""; + export default function DefaultSearchDialog(props: SharedProps) { const { locale } = useI18n(); // (optional) for i18n const { search, setSearch, query } = useDocsSearch({ type: "static", initOrama, locale, + from: `${basePath}/api/search`, }); return (