gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

[SiteMap] sitemap-index.xml is referencing the wrong sitemap path #31355

Closed mwskwong closed 3 years ago

mwskwong commented 3 years ago

Description

Using the default config of gatsby-plugin-sitemap, the sitemap-index.xml is referencing the rest of the sitemap files as siteUrl/sitemap-0.xml instead of siteUrl/sitemap/sitemap-0.xml.

Steps to reproduce

  1. Use any starter template
  2. Install gatsby-plugin-sitemap
  3. Build the project

Since this bug is only reproducible in the production build, I have linked it to my personal project instead. https://github.com/matthewkwong2/resume-gatsby/tree/main

Expected result

The sitemap-x.xml should be linked in sitemap-index.xml with the correct hyperlink siteUrl/sitemap/sitemap-x.xml with the default config.

Actual result

The sitemap-x.xml is linked as siteUrl/sitemap-x.xml instead.

Environment

  System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  Binaries:
    Node: 15.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 7.11.1 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.9.4
  Browsers:
    Chrome: 90.0.4430.93
    Edge: Spartan (44.18362.449.0)
  npmPackages:
    gatsby: ^3.4.2 => 3.4.2 
    gatsby-plugin-emotion: ^6.4.0 => 6.4.0 
    gatsby-plugin-image: ^1.4.1 => 1.4.1 
    gatsby-plugin-manifest: ^3.4.0 => 3.4.0 
    gatsby-plugin-offline: ^4.4.0 => 4.4.0 
    gatsby-plugin-react-helmet: ^4.4.0 => 4.4.0 
    gatsby-plugin-robots-txt: ^1.6.2 => 1.5.6 
    gatsby-plugin-root-import: ^2.0.6 => 2.0.6 
    gatsby-plugin-sharp: ^3.4.2 => 3.4.2 
    gatsby-plugin-sitemap: ^4.0.0 => 4.0.0 
    gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.22 => 1.1.21 
    gatsby-source-filesystem: ^3.4.0 => 3.4.0 
    gatsby-transformer-sharp: ^3.4.0 => 3.4.0 
  npmGlobalPackages:
    gatsby-cli: 3.0.0

Flags

{
  FAST_DEV: true,
  DEV_SSR: true,
  PRESERVE_FILE_DOWNLOAD_CACHE: true,
  PRESERVE_WEBPACK_CACHE: true
}
gehaktmolen commented 3 years ago

Duplicate of https://github.com/gatsbyjs/gatsby/issues/31167 ?

LekoArts commented 3 years ago

Yes, this is a duplicate of https://github.com/gatsbyjs/gatsby/issues/31167