-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'gatsby-plugin-sitemap' doesn't generate a /sitemap.xml file #31095
Comments
I'm also having issue with the sitemap plugin with |
I've also experienced this issue after upgrading to 4.0.0. In version 3.3.0 using I also tried the example config from the docs which again returned no errors but did not create a file. The plugin code appears to run correctly as a console.log inside the example prints out as expected |
Were you running |
This is when running |
I just tried removing my node_modules and package-lock.json for a fresh install and the problem still persists. 😢 If it's any help i've added my environment below:
|
My understanding is that the gatsby-plugin-sitemap version 4.0.0 is generating the files under a Check the html headers in your generated files, search for "sitemap" and you will see the new path. Having said that, I still think there must be some bug, as the index file has "/sitemap-0.xml" instead of the expected "/sitemap/sitemap-0.xml" I've tried setting "output" to "" in the config, but apparently, gatsby doesn't allow generating the sitemaps on the root now... |
I can confirm I can find the files in /public/sitemap. Is there a particular reason this change was made? Just seems odd to deviate from the default sitemap location. For anyone using a plugin such as gatsby-plugin-robots-txt you will need to update the path to your sitemap. Same applies for manually generated files or submitted urls. Perhaps a note on the plugin page would help? It looks like you can still generate the sitemap files in the root by doing |
Using |
I had the same issue, it was saying something about adding a 'resolvePages' function |
Thanksss, that brings me a step further. I can find mine at 'http://localhost:9000/sitemap/sitemap-0.xml', now i'm tryna figure out why it's not at the root what @pedrolamas said... |
I've putted this together with the v4 documentation, and its working like before..
Hope this helps you out as well guys, PS: i'm still looking for the simple /sitemap.xml slug option.. but this gets me a lot further. |
Mine is here, if anyone is interested (but has the issues reported above): https://github.com/pedrolamas/pedrolamas.com/blob/bf3c9107f6b1f33a431972dcbac55be1d361ce71/gatsby-config.js#L169-L194 |
I've submitted a small PR that will allow setting |
I can confirm that reverting to 3.3.0 fixes the issue. Careful about the breaking change from |
Thanks all for the notes. I think the |
I'm closing this cause it's gotten quite off topic and the original problem was solved. I have opened an issue for incorrect folder path (#31167). If you have an issue different from the original that isn't resolved please open an issue. Thanks all. |
I'm still getting errors even with the minimal config.
is the |
Hi @flikteoh ! Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you open a new issue. Please include a minimal reproduction and a copy of any relevant code/config or a link to the repository. Thanks for using Gatsby! 💜 |
Hi, I had the same issue @flikteoh , since I didn't want the sitemap to start with, I just deleted it from @moonmeister : don't know if this is very helpful there, but I didn't find a new issue... here is my config file:
|
@dcxSt If you have an issue, please open a new one. |
Description
'gatsby-plugin-sitemap' doesn't generate a sitemap.xml file, even with default config.
I've changed to the default config of this plugin. In the past it worked like a charm with this code (beneath) but since gatsby-plugin-sitemap v4 it stopped working. Now even the default config doesn't show me the sitemap by going to 'yoursiteurl.com/sitemap.xml'.
or
The old config gives me serializing errors and the second (default) one gives me no sitemap, but goes to 404. What am i doing wrong??
Expected result
Sitemap should show up when I
gatsby build && gatsby serve
and go to localhost:9000/sitemap.xml ('localhost:9000/sitemap' isn't working either)Actual result
No sitemap to be found...
Environment
The text was updated successfully, but these errors were encountered: