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

Localized Sitemap Does Not Work #67813

Open
Barzi-Ahmed opened this issue Jul 16, 2024 · 2 comments
Open

Localized Sitemap Does Not Work #67813

Barzi-Ahmed opened this issue Jul 16, 2024 · 2 comments
Labels
bug Issue was opened via the bug report template. Internationalization (i18n) Related to Internationalization with Next.js.

Comments

@Barzi-Ahmed
Copy link

Link to the code that reproduces this issue

https://github.com/Barzi-Ahmed/my-app

To Reproduce

  1. Start application with pnpm run dev or pnpm run dev --turbo (issue is present in both).
  2. In the URL of the browser, go to sitemap.xml page by writing /sitemap.xml

STORY:
When creating sitemap.ts and using this same code from docs, this is the result I get:
image

I have searched through GitHub issues and found #63764, and there it is mentioned that you should use Next 14.2, but I already use the latest version of Next.js (details below), and this means it is still not fixed.

Current vs. Expected behavior

Obviously the mentioned sitemap sample doesn't render correctly at all as a normal XML page.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 8043
  Available CPU cores: 8
Binaries:
  Node: 20.15.1
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.5 // Latest available version is detected (14.2.5).
  eslint-config-next: 14.2.5
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.3
Next.js Config:
  output: N/A

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

Internationalization (i18n)

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

next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

I use Chrome Version 126.0.6478.127 (Official Build) (64-bit)

@Barzi-Ahmed Barzi-Ahmed added the bug Issue was opened via the bug report template. label Jul 16, 2024
@github-actions github-actions bot added the Internationalization (i18n) Related to Internationalization with Next.js. label Jul 16, 2024
@archanaagivale30
Copy link
Contributor

@Barzi-Ahmed, the sitemap generation looks fine if you look at it in the network tab. The issue is not with NextJs sitemap generation it's with xhtml:link tags in the browser. You can refer to the discussion for the same issue https://support.google.com/webmasters/thread/161147229/will-google-still-recognize-my-sitemap-if-i-change-the-declaration-protocol?hl=en

@Barzi-Ahmed
Copy link
Author

I didn't understand. Please tell me how do I solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Internationalization (i18n) Related to Internationalization with Next.js.
Projects
None yet
Development

No branches or pull requests

2 participants