followbl
(followbl)
May 22, 2025, 2:40pm
1
posted this in github as well, confused as to where is the proper place to post for community/team help anymore, is it in github or here
having some issues with use cache and new Date within 3rd party analytics providers, not sure how we should be handling - some guidance from the team would be appreciated
opened 08:05PM - 26 Feb 25 UTC
dynamicIO
use cache
### Link to the code that reproduces this issue
https://github.com/a463/next-da… te-now-cache-error
### To Reproduce
1. Clone the repo
2. Run `npm run build`
### Current vs. Expected behavior
Currently the build throws:
```md
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 a (.next/server/app/page.js:1:3890)
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
Export encountered an error on /page: /, exiting the build.
⨯ Next.js build worker exited with code: 1 and signal: null
```
The reproduction is very minimal, it has a single route with a `use cache` directive, it makes a request to a placeholder API and then renders a client component. The client components calls `Date.now()`, the error is thrown despite the call being within a `use cache`
### Provide environment information
```bash
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Thu Oct 5 21:02:42 UTC 2023
Available memory (MB): 32768
Available CPU cores: 16
Binaries:
Node: 22.13.1
npm: 10.9.2
Yarn: 1.22.22
pnpm: 9.12.1
Relevant Packages:
next: 15.2.0-canary.76 // Latest available version is detected (15.2.0-canary.76).
eslint-config-next: N/A
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: N/A
```
### Which area(s) are affected? (Select all that apply)
dynamicIO
### Which stage(s) are affected? (Select all that apply)
next build (local), next dev (local)
### Additional context
_No response_