Skip to content

[cacheComponents]: Sitemaps are flagged as 'Dynamic Routes' by default #85375

@WarFiN123

Description

@WarFiN123

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    MetadataRelated to Next.js' Metadata API.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions