nextjs - ✅(Solved) Fix Docs: Incorrect TypeScript JSDoc for cacheComponents [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85271Fetched 2026-04-08 02:16:39
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Assignees
Timeline (top)
assigned ×1commented ×1cross-referenced ×1issue_type_added ×1

Fix Action

Fixed

PR fix notes

PR #85274: chore: update jsDocs for cacheComponents

Description (problem / solution / changelog)

Closes: https://github.com/vercel/next.js/issues/85271

Changed files

  • packages/next/src/server/config-shared.ts (modified, +5/-3)
RAW_BUFFERClick to expand / collapse

What is the documentation issue?

The TypeScript JSDoc shown in editors says:

“When enabled, Next.js will automatically cache page-level components and functions...”

This is misleading and the reverse of the actual behavior.

According to the official docs:

“The cacheComponents flag causes data fetching operations in the App Router to be excluded from pre-renders unless they are explicitly cached. … It is expected to be used in conjunction with use cache so that your data fetching happens at runtime by default unless you define specific parts of your application to be cached.”

So enabling cacheComponents opts into the runtime-first caching model — it does not automatically cache components. The JSDoc should be updated to reflect that.

Is there any context that might help us understand?

https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents

Does the docs page already exist? Please link to it.

No response

extent analysis

TL;DR

Update the TypeScript JSDoc for cacheComponents to reflect that it opts into the runtime-first caching model, rather than automatically caching components.

Guidance

  • Review the official Next.js documentation on cacheComponents to understand its actual behavior and intended use.
  • Verify the current JSDoc text in editors to confirm the misleading description.
  • Update the JSDoc comment to accurately describe the effect of enabling cacheComponents, using language consistent with the official documentation.
  • Consider adding a note or example to the documentation to clarify the relationship between cacheComponents and use cache.

Example

// Example of updated JSDoc comment
/**
 * Enables the runtime-first caching model, excluding data fetching operations from pre-renders unless explicitly cached.
 * @see https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents
 */

Notes

The fix relies on accurate documentation and understanding of the cacheComponents flag. Ensure that the updated JSDoc comment is consistent with the official Next.js documentation.

Recommendation

Apply workaround: Update the JSDoc comment to accurately reflect the behavior of cacheComponents, as this will help prevent confusion and ensure correct usage.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - ✅(Solved) Fix Docs: Incorrect TypeScript JSDoc for cacheComponents [1 pull requests, 1 comments, 2 participants]