Next.js Discord

Discord Forum

[Sitemap, SEO, Localization] Next.js renders application/xml as plain text

Unanswered
Hokkaido posted this in #help-forum
Open in Discord
HokkaidoOP
Next.js renders application/xml as plain text when tags are present in the XML body.
Here is a minimal reproduction of the source of the issue:
https://github.com/rocelyfood/nextjs-15.3.3-sitemap-error
https://sitemap-languages-bug.vercel.app/

The correctly set, but incorrectly interpreted content-type headers are also scuffing with SEO because the sitemap won't be recognised. This issue somehow just recently occurred - A couple of weeks ago, our sitemap looked fine. For reference, here is our production sitemap, which shares the exact same issue as the reproduction provided above: https://www.rocely.com/sitemap.xml

2 Replies

HokkaidoOP
BUMP this is very important and still broken!
Also created a GitHub issue for this: https://github.com/vercel/next.js/issues/80237