[ BUG ] Sitemap not generated when url count is less than 5.
vikaskrsharma opened this issue · 3 comments
When generating a sitemap xml using SitemapStream and if number of items write is less than 5 ie number of items passed for url generation is less than 5, generated xml does not show any data. For 5 or more item/urls, it is working fine.
Do you have example code for this?
I ask because:
- There is literally a test that writes 2 items:
sitemap.js/tests/sitemap-stream.test.ts
Lines 17 to 28 in 815680c
- I suspect this is a usage error that will be obvious if we can see the example code
- I have a production system that has been writing arbitrary numbers of items to new sitemap files and has not had an error in 2+ years... not a guarantee that there is no problem, but I think this is pretty solid
- I am aware that there are lots of gotchas with streams that can cause subtle problems
@huntharo As i am not working on this project anymore, can't paste the code. but the case was, if i am passing less than 5 url to the SitemapStream, i am getting nothing in sitemap url. but i pass 6 or more url, i was getting sitemap with all urls. As per your test, this case should fail. but when was using it on my env, this was the actual behaviour.