Skip to content

Localization Breaking Sitemap #80237

@rocelyblooming

Description

@rocelyblooming

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

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 128630
  Available CPU cores: 32
Binaries:
  Node: 22.11.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: 9.15.4
Relevant Packages:
  next: 15.3.3 // Latest available version is detected (15.3.3).
  eslint-config-next: 15.3.3
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    HeadersRelated to the async headers() function.Internationalization (i18n)Related to Internationalization with Next.js.Linking and NavigatingRelated to Next.js linking (e.g., <Link>) and navigation.MetadataRelated to Next.js' Metadata API.MiddlewareRelated to Next.js Middleware.Route HandlersRelated to Route Handlers.create-next-appRelated to our CLI tool for quickly starting a new Next.js application.locked

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions