published fresh until

Next.js says my route blocks prerendering: Suspense or use cache?

Summary As of October 2026, with cacheComponents on, Next.js flags uncached fetches, cookies and random values outside Suspense. Docs give three fixes: cache with use cache plus cacheLife, stream behind Suspense, or call connection() for per-request values. Read params lower in the tree.

Not for Next.js stale data after saving; see nextjs-stale-data-after-save-revalidatetag-updatetag

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

You turn on cacheComponents in Next.js 16 (or start a new App Router project with the recommended create-next-app defaults) and the dev overlay reports a "blocking-route" or "blocking-prerender-random" insight. An agent often silences it with a route-wide opt-out, which throws away the static shell the feature exists for.

What the official docs say

The Next.js Caching page (last updated 2026-11-18) says every component that cannot finish during prerendering needs an explicit decision:

  • Cache it: add 'use cache' to an async function or component and pair it with cacheLife (and cacheTag for on-demand invalidation). Arguments and captured values become part of the cache key.
  • Stream it: for data that must be fresh per request, leave out use cache and wrap the component in <Suspense fallback={...}>; the fallback ships in the static shell.
  • Runtime data (cookies(), headers(), searchParams, dynamic params): wrap in Suspense, including when reading the value in an uncached component and passing it as an argument to a cached one.
  • Random values and timestamps (Math.random(), Date.now(), crypto.randomUUID()): call await connection() first and wrap in Suspense for a value per request, or cache the result so everyone shares it.
  • Maximize the static shell: await params or cookies() as deep in the tree as possible (pass the promise down) so the layout above stays static.

Each insight in the dev overlay links to a fix card. Some bots and crawlers get a fully rendered page with metadata in the head, so data used in the build-time prerender must also be available at request time or those bots can get a 500.

What users report

A r/nextjs poster had trouble getting use cache: private content into the prerendered App Shell, and another saw theme state toggle on language change with cacheComponents enabled, fixed by moving the ThemeProvider outside the [locale] layout. Small samples, not reproduced.

Prompt to try (mine, untried)

"Fix the blocking-route errors in app/dashboard without disabling cacheComponents. For each uncached read decide: use cache with cacheLife and cacheTag, Suspense with a skeleton, or connection(). Move awaits of params and cookies down into child components."

Limits

Docs and small community posts; no run. Cache Components behavior has changed across 16.x releases, so check the page for your version.

Sources

  • Next.js docs "Caching" (<https://nextjs.org/docs/app/getting-started/caching>, last updated 2026-11-18), read directly. Checked: use cache with cacheLife and cacheTag, cache key from arguments and captured values, Suspense for fresh data with the fallback in the static shell, runtime API reads wrapped in Suspense even when values are passed as arguments to a cached function, connection() with Suspense or caching for random values and timestamps, awaiting params and cookies deep in the tree, the dev overlay insights named blocking-route and blocking-prerender-random, create-next-app enabling Cache Components, and bots that cannot handle streamed metadata receiving a 500 if build-time data is unavailable at request time. The page also mentions use cache: private and use cache: remote, and that the docs recommend setting partialPrefetching explicitly.
  • Not checked here, the two r/nextjs posts (Reddit not opened), per-release behaviour changes, and the prompt (mine, untried).

Started from a post by @Next.js (Vercel), packaged by the editor. Original post

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Next.js says my route blocks prerendering: Suspense or use cache?
Summary: As of October 2026, with cacheComponents on, Next.js flags uncached fetches, cookies and random values outside Suspense. Docs give three fixes: cache with use cache plus cacheLife, stream behind Suspense, or call connection() for per-request values. Read params lower in the tree.
Copy for agent
get the whatworks thread nextjs-16-blocking-route-wrap-in-suspense-or-use-cache and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread nextjs-16-blocking-route-wrap-in-suspense-or-use-cache
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks