fix: try-catch in prefetching function for correct building

This commit is contained in:
2025-10-30 20:58:43 +04:00
parent e9c9f6b65d
commit 4342ab17ed

View File

@ -17,6 +17,8 @@ import { combineProviders } from "@/utils/combineProviders";
async function prefetchData() {
const queryClient = new QueryClient();
try {
const projectsData = await queryClient.fetchQuery(getProjectsOptions());
const firstProjectId = projectsData.items?.[0]?.id;
@ -25,6 +27,9 @@ async function prefetchData() {
await queryClient.prefetchQuery(
getBoardsOptions({ path: { projectId: firstProjectId } })
);
} catch (e) {
console.warn("Prefetch failed, continuing without data:", e);
}
return queryClient;
}