Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
`use cache` + `cacheLife` unexpectedly requires Suspense boundary | GoodFirstPicks

`use cache` + `cacheLife` unexpectedly requires Suspense boundary

vercel/next.js 1 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

The issue involves unexpected Suspense boundary requirements for cacheLife usage.

AI Summary

The issue highlights an inconsistency where changing cacheLife parameters unexpectedly requires a Suspense boundary, which is not intuitive or documented. The fix likely involves modifying how cacheLife interacts with Suspense boundaries, but the exact scope and impact are unclear.

Issue Description

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/dawn-voice-vrxzm9

To Reproduce

  1. Visit the reproduction app
  2. Click the cacheLife("minutes") link. Notice that it works and does not cause errors.
  3. Go back, and click the cacheLife("seconds") link. Notice the following server-side error:

    [ Server ] Error: Route "/seconds": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense

  4. Go back, and click the cacheLife({ expire: 299 }) link. Notice the following server-side error:

    [ Server ] Error: Route "/expire299": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense

Current vs. Expected behavior

The current behavior demands a Suspense boundary when the developer changes a cacheLife("minutes") call to cacheLife("seconds") call. I expect for such a change to be local / isolated, and to not require any other changes to an app.

Likewise for changing a cacheLife({ expire: 300 }) call to cacheLife({ expire: 299 }) (or, generally, from >= 300 to < 300).

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.1.1-canary.13 // Latest available version is detected (15.1.1-canary.13).
  

GitHub Labels

linear: nextCache Components

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • behavioral inconsistency
  • potential architectural implications
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno