Maximum call stack size exceeded Error when using mixedbread search api #2730
Unanswered
salartalaA
asked this question in
Q&A
Replies: 1 comment 3 replies
-
|
Would be better if you can provide more details, like a reproduction and conditions to trigger the error if applicable. It could be an upstream issue that is tricky to solve. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I really don't know why I got this error
but I'm sure there is something wrong (magic huh)
Would someone please help me in this case?
Thank you all :]
layout.tsx:
{children}provider.tsx:
const params = useParams();
const lang = params.lang as string;
const dir = lang === "fa" ? "rtl" : "ltr";
return (
<RootProvider
i18n={provider(lang)}
dir={dir}
search={{
SearchDialog,
}}
>
{children}
);
}
search.tsx:
"use client";
import {
SearchDialog,
SearchDialogClose,
SearchDialogContent,
SearchDialogFooter,
SearchDialogHeader,
SearchDialogIcon,
SearchDialogInput,
SearchDialogList,
SearchDialogOverlay,
type SharedProps,
} from "fumadocs-ui/components/dialog/search";
import { useDocsSearch } from "fumadocs-core/search/client";
import { useI18n } from "fumadocs-ui/contexts/i18n";
import Mixedbread from "@mixedbread/sdk";
const client = new Mixedbread({
apiKey: process.env.NEXT_PUBLIC_MIXEDBREAD_API_KEY,
// baseURL: "https://api.example.com", // Optional, defaults to https://api.mixedbread.com
});
export default function CustomSearchDialog(props: SharedProps) {
const { locale } = useI18n(); // (optional) for i18n
const { search, setSearch, query } = useDocsSearch({
type: "mixedbread",
client,
vectorStoreId: process.env.NEXT_PUBLIC_MIXEDBREAD_STORE_ID!,
locale,
});
return (
<SearchDialog
search={search}
onSearchChange={setSearch}
isLoading={query.isLoading}
{...props}
>
<SearchDialogList items={query.data !== "empty" ? query.data : null} />
);
}
Beta Was this translation helpful? Give feedback.
All reactions