nextjs - 💡(How to fix) Fix [cacheComponents]: Sitemaps are flagged as 'Dynamic Routes' by default [10 comments, 6 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#85375Fetched 2026-04-08 02:16:04
View on GitHub
Comments
10
Participants
6
Timeline
26
Reactions
2
Author
Timeline (top)
commented ×10subscribed ×6mentioned ×4labeled ×3

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home Single Language
  Available memory (MB): 32540
  Available CPU cores: 16
Binaries:
  Node: 24.8.0
  npm: 11.5.2
  Yarn: N/A
  pnpm: 10.19.0
Relevant Packages:
  next: 16.0.1-canary.2 // Latest available version is detected (16.0.1-canary.2).
  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/WarFiN123/nextjs-reproduction-app

To Reproduce

  1. Enable cacheComponents in the Next.js config file.
  2. Add a sitemap file.
  3. Run next build

Current vs. Expected behavior

Current Behaviour: Next.js will flag /sitemap.xml as a dynamic route instead of a static one

Expected Behaviour: Next.js should flag /sitemap.xml as a static route unless explicitly defined to be a dynamic one by the user

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home Single Language
  Available memory (MB): 32540
  Available CPU cores: 16
Binaries:
  Node: 24.8.0
  npm: 11.5.2
  Yarn: N/A
  pnpm: 10.19.0
Relevant Packages:
  next: 16.0.1-canary.2 // Latest available version is detected (16.0.1-canary.2).
  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)

Metadata, cacheComponents

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

next build (local)

Additional context

I can also open a PR for the fix

extent analysis

TL;DR

Disable cacheComponents in the Next.js config file to potentially resolve the issue with /sitemap.xml being flagged as a dynamic route instead of a static one.

Guidance

  • Review the Next.js config file to ensure that cacheComponents is not enabling dynamic routing for /sitemap.xml unintentionally.
  • Verify that the sitemap file is correctly configured according to Next.js documentation to ensure it's treated as a static route.
  • Check if there are any other configurations or plugins that might be influencing the routing behavior of /sitemap.xml.
  • Consider testing with a minimal reproducible example to isolate the cause of the issue.

Example

No code snippet is provided as the issue seems to be related to configuration rather than code.

Notes

The provided information suggests that the issue might be specific to the cacheComponents configuration and the presence of a sitemap file. However, without further details on the exact configurations and the expected behavior, it's difficult to provide a definitive solution.

Recommendation

Apply workaround: Disable cacheComponents to see if it resolves the issue, as this setting seems to be the most likely cause of the problem. This is recommended because it directly addresses the potential root cause mentioned in the issue description.

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 [cacheComponents]: Sitemaps are flagged as 'Dynamic Routes' by default [10 comments, 6 participants]