Skip to content

Conversation

@SahilMotiramani
Copy link

What does this change?

When app/sitemap.ts uses generateSitemaps(), Next.js only generates
/sitemap/[id].xml routes and does not generate a root /sitemap.xml.

However, in next dev, the app route matcher always reserved /sitemap.xml
for sitemap.ts, which caused a false duplicate route warning when users
defined app/sitemap.xml/route.ts for a sitemap index.

This PR updates the dev app route matcher to skip generating the single
sitemap.xml route for sitemap entries and adds a regression test.

Why is this safe?

  • Dev-only change
  • No production behavior changes
  • No breaking changes
  • Covered by a new test

Reproduction

See issue #87314.

@SahilMotiramani
Copy link
Author

This PR is from a first-time contributor.
The build-native-windows job failed due to runner validation.
Could a maintainer please rerun or approve the workflow?
Thanks!

@SahilMotiramani
Copy link
Author

@eps1lon would like to request a review, if any changes required please tell else please merge

@SahilMotiramani
Copy link
Author

@feedthejim @unstubbable @timneutkens
I would like to request do a review on my pull and if you find it correct please merge or please inform the changes😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants