nextjs - 💡(How to fix) Fix Wrong docs link in nextjs dev tools error overlay when using "use cache" directive with no cacheComponents feature flag set [3 comments, 4 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#85506Fetched 2026-04-08 02:15:20
View on GitHub
Comments
3
Participants
4
Timeline
9
Reactions
0
Author
Assignees
Timeline (top)
commented ×3labeled ×2assigned ×1closed ×1

Error Message

Ecmascript file had an error Actual > https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage throws 404 error Error Overlay

Code Example

Ecmascript file had an error
> 1 | 'use cache'
    | ^^^^^^^^^^^

To use "use cache", please enable the feature flag `cacheComponents` in your Next.js config.

Read more: **https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage**

---

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32528
  Available CPU cores: 8
Binaries:
  Node: 22.16.0
  npm: 11.2.0
  Yarn: N/A
  pnpm: N/A
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/serjdrn/nextjs-boilerplate

To Reproduce

  1. Start app in local dev
  2. Use the "use cache" flag without having cacheComponents feature flag enabled
  3. Click the link to proper usage

Current vs. Expected behavior

Ecmascript file had an error
> 1 | 'use cache'
    | ^^^^^^^^^^^

To use "use cache", please enable the feature flag `cacheComponents` in your Next.js config.

Read more: **https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage**

Expected > Redirect to https://nextjs.org/docs/app/api-reference/directives/use-cache on click

Actual > https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage throws 404 error

This link needs updating https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage to the one that works

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32528
  Available CPU cores: 8
Binaries:
  Node: 22.16.0
  npm: 11.2.0
  Yarn: N/A
  pnpm: N/A
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)

Error Overlay

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

next dev (local)

Additional context

No response

extent analysis

TL;DR

Enable the cacheComponents feature flag in the Next.js config to resolve the error when using the "use cache" flag.

Guidance

  • The error message indicates that the cacheComponents feature flag is not enabled, which is required to use the "use cache" flag.
  • To fix the issue, update the Next.js config to include the cacheComponents feature flag.
  • Verify that the cacheComponents feature flag is correctly enabled by checking the Next.js config file.
  • If the issue persists, ensure that the Next.js version is compatible with the cacheComponents feature flag.

Example

No code snippet is provided as the issue is related to configuration and not code-specific.

Notes

The issue is specific to the local development environment (next dev) and is related to the Error Overlay area. The cacheComponents feature flag is required to use the "use cache" flag, and enabling it should resolve the error.

Recommendation

Apply workaround: Enable the cacheComponents feature flag in the Next.js config, as it is required to use the "use cache" flag and is not enabled by default.

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