Open arvinpoddar opened 3 weeks ago
I'm facing the same problem too. However when inspecting the network response, the XML looks valid
and running the sitemap.xml link to a sitemp checker like https://www.mysitemapgenerator.com/service/check.html, it passes
Not an expert but I assume this is functionally working, the browser just shows an error displaying the xml
Were you able to resolve this issue? Google search console is not seeing localized versions of the page?
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/elastic-wave-5d4hkj?workspaceId=b7d16bab-058a-4b6f-b4f8-cb3182273009
To Reproduce
npx create-next-app@latest
(accept all the default settings)app/sitemap.ts
filelocalhost:3000/sitemap.xml
Current vs. Expected behavior
We would expect to see a sitemap with localized alternates when we visit
localhost:3000/sitemap.xml
. Instead, visiting this route results in a plain text result, with aUncaught TypeError: Cannot read properties of null (reading 'childNodes')
error in the browser console.Provide environment information
Which area(s) are affected? (Select all that apply)
Metadata
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
This issue is a duplicate of: https://github.com/vercel/next.js/issues/65817