Skip to content

sitemap.ts with MetadataRoute generates error standard xml, urlset xmlns is http, not https #81959

@vadxq

Description

@vadxq

Link to the code that reproduces this issue

https://github.com/vadxq/nextjs-ai-starter

To Reproduce

The sitemap.xml generated using the initialized sitemap.ts should have two namespaces that should be http, but now it has become https. This is wrong, Google console does not recognize this.

The standard is http:
This is the standard: https://www.sitemaps.org/protocol.html

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

This is the current generated error

<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="https://www.w3.org/1999/xhtml">
<url>
<loc>

Current vs. Expected behavior

The standard is http:
This is the standard: https://www.sitemaps.org/protocol.html

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

This is the current generated error

<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="https://www.w3.org/1999/xhtml">
<url>
<loc>

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:43 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8132
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 24.4.0
  npm: 11.4.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.4.1 // There is a newer version (15.4.3) available, upgrade recommended! 
  eslint-config-next: 15.4.1
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A
 ⚠ There is a newer version (15.4.3) available, upgrade recommended! 
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

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

Metadata

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

Vercel (Deployed)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    MetadataRelated to Next.js' Metadata API.locked

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions