I am having trouble creating the appropriate context with the tanstack query client. The documentation says to use a type that asks for a NextApiResponse but all I can get is a plain NextResponse. Is there something I'm missing?
When trying to prefetch data with TanStack Query it fails with the following:
A query that was dehydrated as pending ended up rejecting. [[["tradeList"],{"type":"query"}]]: TypeError: (0 , __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f2e$pnpm$2f$next$40$15$2e$3$2e$0_react$2d$dom$40$19$2e$1$2e$0_react$40$19$2e$1$2e$0_$5f$react$40$19$2e$1$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__.createContext) is not a function; The error will be redacted in production builds
⨯ [Error: redacted] { digest: '2062921512' }
A query that was dehydrated as pending ended up rejecting. [[["tradeList"],{"type":"query"}]]: TypeError: (0 , __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f2e$pnpm$2f$next$40$15$2e$3$2e$0_react$2d$dom$40$19$2e$1$2e$0_react$40$19$2e$1$2e$0_$5f$react$40$19$2e$1$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$rsc$2f$react$2e$js__$5b$app$2d$rsc$5d$__$28$ecmascript$29$__.createContext) is not a function; The error will be redacted in production builds
⨯ [Error: redacted] { digest: '2062921512' }
Once the page loads the data appears and it keeps loading it every few seconds.
I have a query that has a couple fields with the Date type, however when queried with TanStack they are being returned as string. Is there a way to cast them to Date again?