withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.32k stars 2.45k forks source link

Localized Sitemap Generation with @astrojs/sitemap Fails to Render Correct XML Structure on Vercel Deployment #12049

Closed inotelabs closed 4 weeks ago

inotelabs commented 1 month ago

Astro Info

Astro                    v4.15.7
Node                     v22.8.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/sitemap
                         @astrojs/mdx
                         pagefind
                         @astrojs/tailwind
                         astro-icon
                         @astrojs/partytown

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

In my Astro multi-language project, I am using the official @astrojs/sitemap plugin to generate localized sitemap files. While the sitemap files (sitemap-0.xml, etc.) are correctly generated with proper XML structures in the local development environment, the deployed version on Vercel fails to display the correct XML structure. Instead, the sitemap files only show a list of URLs without the necessary XML tags, preventing search engines from properly parsing and indexing the website.

Sitemap URLs:

•   https://verse-i18n.vercel.app/sitemap-index.xml
•   https://verse-i18n.vercel.app/sitemap-0.xml

What's the expected result?

In the production environment on Vercel, sitemap files (sitemap-index.xml, sitemap-0.xml, etc.) should be generated with the correct XML structure, including , , and other necessary XML tags. This structure is essential for search engines like Google to parse and index the website effectively.

Link to Minimal Reproducible Example

https://github.com/isooosi/Astroverse-i18n

Participation

florian-lefebvre commented 4 weeks ago

Even if doesn't show properly the XML in the browser, it's absolutely fine. If you open the devtools, the structure is good