The issue involves unexpected Suspense boundary requirements for cacheLife usage.
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.
https://codesandbox.io/p/devbox/dawn-voice-vrxzm9
cacheLife("minutes") link. Notice that it works and does not cause errors.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
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
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).
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).
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!