-
Notifications
You must be signed in to change notification settings - Fork 31.2k
Localization Breaking Sitemap #80237
Copy link
Copy link
Labels
HeadersRelated to the async headers() function.Related to the async headers() function.Internationalization (i18n)Related to Internationalization with Next.js.Related to Internationalization with Next.js.Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.Related to Next.js linking (e.g., <Link>) and navigation.MetadataRelated to Next.js' Metadata API.Related to Next.js' Metadata API.MiddlewareRelated to Next.js Middleware.Related to Next.js Middleware.Route HandlersRelated to Route Handlers.Related to Route Handlers.create-next-appRelated to our CLI tool for quickly starting a new Next.js application.Related to our CLI tool for quickly starting a new Next.js application.locked
Metadata
Metadata
Assignees
Labels
HeadersRelated to the async headers() function.Related to the async headers() function.Internationalization (i18n)Related to Internationalization with Next.js.Related to Internationalization with Next.js.Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.Related to Next.js linking (e.g., <Link>) and navigation.MetadataRelated to Next.js' Metadata API.Related to Next.js' Metadata API.MiddlewareRelated to Next.js Middleware.Related to Next.js Middleware.Route HandlersRelated to Route Handlers.Related to Route Handlers.create-next-appRelated to our CLI tool for quickly starting a new Next.js application.Related to our CLI tool for quickly starting a new Next.js application.locked
Type
Fields
Give feedbackNo fields configured for Bug.
Link to the code that reproduces this issue
https://github.com/rocelyfood/nextjs-15.3.3-sitemap-error
To Reproduce
Either clone the repository and start it with
npm run dev, or simply open the reproduction deployment here:https://sitemap-languages-bug.vercel.app/
There are two buttons, one returning sitemap XML data with alternates.languages, one without. The one with is broken and gets recognized as plain text, despite response header being application/xml
You can also check the deployments /sitemap.xml
Remove the relevant commented part of the project's app/sitemap.ts file and taddaa the sitemap works again
This is utterly important as it has broken our sitemap on production at www.rocely.com
Current vs. Expected behavior
Expected behaviour:
The sitemap is recognized as application/xml
Current behaviour:
The sitemap is sent as application/xml in the response headers, but it is processed as plain text, which causes Google Search to effectively drop all prior indexed pages. We have lost over 2k indexed pages over the past week because of this issue.
Provide environment information
Which area(s) are affected? (Select all that apply)
create-next-app, Headers, Internationalization (i18n), Linking and Navigating, Metadata, Middleware, Route Handlers
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed), next dev (local), next build (local), next start (local)
Additional context
Tested on 15.3.3 and 15.2.3