client: catch error

This commit is contained in:
fantasticit 2022-06-03 04:26:55 +08:00
parent 86755013b4
commit cd071ccae1
1 changed files with 13 additions and 9 deletions

View File

@ -14,6 +14,7 @@ export async function serverPrefetcher(ctx: NextPageContext, actions: PrefetchAc
return {};
}
try {
const queryClient = new QueryClient();
await Promise.all(
@ -25,4 +26,7 @@ export async function serverPrefetcher(ctx: NextPageContext, actions: PrefetchAc
return {
dehydratedState: dehydrate(queryClient),
};
} catch (err) {
return {};
}
}