nextjs - 💡(How to fix) Fix [Cache Components] Component being displayed in another route that doesn't use it [10 comments, 5 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#85218Fetched 2026-04-08 02:17:04
View on GitHub
Comments
10
Participants
5
Timeline
30
Reactions
6
Timeline (top)
commented ×10subscribed ×10cross-referenced ×3labeled ×2

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:38:03 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8112
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 24.4.0
  npm: 11.4.2
  Yarn: N/A
  pnpm: 10.19.0
Relevant Packages:
  next: 16.0.0 // Latest available version is detected (16.0.0).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/ceolinwill/nextjs16-dropdown-bug

To Reproduce

  1. Clone this repository
  2. Install dependencies using pnpm install
  3. Run the development server with pnpm dev
  4. Open the application in your browser
  5. Click on the "Open Dropdown" button on the top right corner
  6. Click on the "Settings" link in the dropdown menu

Current vs. Expected behavior

Current behavior:

It shows the dropdown menu on the "settings" page, even though it's not included there

Expected behavior

It shouldn't show the dropdown menu when navigating to a page that doesn't include it

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:38:03 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8112
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 24.4.0
  npm: 11.4.2
  Yarn: N/A
  pnpm: 10.19.0
Relevant Packages:
  next: 16.0.0 // Latest available version is detected (16.0.0).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

cacheComponents

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

  • This bug was introduced in Next.js 16-canary.17 (it works fine on canary.16)
  • The bug occurs only when cacheComponents is enabled in next.config.ts. If we disable it, the dropdown works as expected

extent analysis

TL;DR

  • The issue can likely be resolved by adjusting the cacheComponents configuration in next.config.ts to properly handle the dropdown component.

Guidance

  • Investigate the cacheComponents configuration in next.config.ts to ensure it is correctly set up to exclude the dropdown component from caching on pages where it is not included.
  • Verify that the dropdown component is properly unmounted when navigating away from pages that include it.
  • Check the Next.js documentation for any known issues or updates related to cacheComponents in version 16.0.0.
  • Consider temporarily disabling cacheComponents to confirm whether it is the root cause of the issue.

Example

  • No code example is provided due to the lack of specific code details in the issue.

Notes

  • The issue seems to be closely related to the cacheComponents feature in Next.js 16.0.0, and resolving it may require a deeper understanding of how this feature interacts with the dropdown component.
  • The fact that the issue was introduced in a specific canary version and is resolved by disabling cacheComponents suggests that the problem is likely related to how Next.js handles component caching.

Recommendation

  • Apply workaround: Temporarily disable cacheComponents in next.config.ts to prevent the dropdown menu from being incorrectly cached and displayed on pages where it is not included, until a more permanent solution or fix from Next.js is available.

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 - 💡(How to fix) Fix [Cache Components] Component being displayed in another route that doesn't use it [10 comments, 5 participants]