Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

fix(query-cache): guard against undefined from superjson.parse on legacy cache entries (#6228)

Thomas1297e6c2aca4
diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx
index ee45a8b35..5be6b2996 100644
--- a/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx
+++ b/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx
@@ -123,9 +123,9 @@ async function QueryCacheHydration({ userId, boardId }: { userId: string; boardI
const serialized = await getQueryCacheAsync(userId, boardId);
if (!serialized) return null;
- const persisted = superjson.parse<PersistedClient>(serialized);
- if (persisted.buster !== queryCacheBuster) return null;
- if (!persisted?.clientState?.queries?.length) return null;
+ const persisted = superjson.parse<PersistedClient | undefined>(serialized);
+ if (!persisted || persisted.buster !== queryCacheBuster) return null;
+ if (!persisted.clientState?.queries?.length) return null;
return <HydrationBoundary state={persisted.clientState} />;
} catch (error) {