Describe the bug
In Next.js 15 with cacheComponents (formerly dynamicIO) turned on, dehydration causes an error:
Error: Route "/" used `Date.now()` instead of using `performance` or without explicitly calling `await connection()` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time
at Home (app/page.tsx:15:42)
at Home (<anonymous>)
13 | <main>
14 | <h1>Pokemon Info</h1>
> 15 | <HydrationBoundary state={dehydrate(queryClient)}>
| ^
16 | <PokemonInfo />
17 | </HydrationBoundary>
18 | </main>
I think it's this Date.now() usage here:
|
dehydratedAt: Date.now(), |
I believe this issue is similar to #8277.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/blazing-moon-kyqpg5
Steps to reproduce
I took the example at https://tanstack.com/query/latest/docs/framework/react/examples/nextjs-app-prefetching, changed to Next.js canary and enabled cacheComponents
Expected behavior
No error
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
All platforms
Tanstack Query adapter
react-query
TanStack Query version
5.83.0
TypeScript version
No response
Additional context
No response
Describe the bug
In Next.js 15 with cacheComponents (formerly dynamicIO) turned on, dehydration causes an error:
I think it's this Date.now() usage here:
query/packages/query-core/src/hydration.ts
Line 82 in 3bcaa41
I believe this issue is similar to #8277.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/blazing-moon-kyqpg5
Steps to reproduce
I took the example at https://tanstack.com/query/latest/docs/framework/react/examples/nextjs-app-prefetching, changed to Next.js canary and enabled cacheComponents
Expected behavior
No error
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
All platforms
Tanstack Query adapter
react-query
TanStack Query version
5.83.0
TypeScript version
No response
Additional context
No response