Pick a home for Date.now()
Cache it for everyone, or read it per request after connection().
Next.js docsMessage · blocking-prerender-random
Math.random(), Date.now(), crypto.randomUUID() produce different output each run, so Cache Components makes you choose: per-request (defer) or fixed (cache).
From next-cache-components-optimizer, patterns.md.
Build, then three visitors
Pick the fix, then press Build and request.
Bare in renderBad
<b>{pick(deals, Math.random())}</b>await connection()Good
Which home?
Pick a value your page shows.
Answer
Why it matters, pros and cons
Why it matters
The prerender runs once. A random or current value there would freeze into every visitor's page, so the build asks which you meant.
Pros
- Each value is fresh per visit or shared on purpose.
- The rest of the page stays in the shell.
- The build error names the call and the route.
Cons
connection()moves that part out of the shell.- A cached value is stale until its
cacheLifeends. instant = falsedoes not silence it.