Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create /sitemap route in canary #71119

Closed
darthmaim opened this issue Oct 10, 2024 · 4 comments · Fixed by #71153
Closed

Can't create /sitemap route in canary #71119

darthmaim opened this issue Oct 10, 2024 · 4 comments · Fixed by #71153
Labels
bug Issue was opened via the bug report template. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. locked

Comments

@darthmaim
Copy link
Contributor

darthmaim commented Oct 10, 2024

Link to the code that reproduces this issue

https://github.com/darthmaim-reproductions/vercel-next.js-71119

To Reproduce

  1. Start the application with npm run dev
  2. Visit http://localhost:3000/sitemap
  3. Observe 404 even though the route exists

Current vs. Expected behavior

Currently it is not possible to create a /sitemap route in the latest canary versions, even though I am not using any features from https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap (like sitemap.ts/generateSitemaps/...).

This should just be a normal route.

Renaming the route to anything else (for example site-map) makes the route work.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024
  Available memory (MB): 15953
  Available CPU cores: 8
Binaries:
  Node: 22.5.1
  npm: 10.8.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.0.0-rc.0 // Latest available version is detected (15.0.0-rc.0).
  eslint-config-next: 15.0.0-rc.0
  react: 19.0.0-rc-f994737d14-20240522
  react-dom: 19.0.0-rc-f994737d14-20240522
  typescript: 5.6.3
Next.js Config:
  output: N/A

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

Navigation

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

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

Additional context

This was probably broken by #66477 (cc @huozhi) in https://github.com/vercel/next.js/releases/tag/v15.0.0-canary.24, because this is still working in https://github.com/vercel/next.js/releases/tag/v15.0.0-canary.23.

@darthmaim darthmaim added the bug Issue was opened via the bug report template. label Oct 10, 2024
@github-actions github-actions bot added the Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. label Oct 10, 2024
@1chooo
Copy link

1chooo commented Oct 11, 2024

@darthmaim I think that maybe you loss the .xml, therefore, visit http://localhost:3000/sitemap.xml. It works for me, you can also visit my website as demo: https://1chooo.com

Generating multiple sitemaps 1

While a single sitemap will work for most applications. For large web applications, you may need to split a sitemap into multiple files.

There are two ways you can create multiple sitemaps:

  • By nesting sitemap.(xml|js|ts) inside multiple route segments e.g. app/sitemap.xml and app/products/sitemap.xml.
  • By using the generateSitemaps function.

For example, to split a sitemap using generateSitemaps, return an array of objects with the sitemap id. Then, use the id to generate the unique sitemaps.

Footnotes

  1. https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap#generating-multiple-sitemaps

@darthmaim
Copy link
Contributor Author

I know about those features (and linked to it in my issue description). But I don't want to use any of the Next.js sitemap features, I just want to have a normal route at /sitemap.

@1chooo
Copy link

1chooo commented Oct 12, 2024

I know about those features (and linked to it in my issue description). But I don't want to use any of the Next.js sitemap features, I just want to have a normal route at /sitemap.

You are right, sorry that I provide you the wrong answer.

Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants