-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
v2: Sitemaps are not always generated #2516
Copy link
Copy link
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executionhelp wantedAsking for outside help and/or contributions to this particular issue or PR.Asking for outside help and/or contributions to this particular issue or PR.
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its executionhelp wantedAsking for outside help and/or contributions to this particular issue or PR.Asking for outside help and/or contributions to this particular issue or PR.
Type
Fields
Give feedbackNo fields configured for issues without a type.
🐛 Bug Report
sitemap.xmlis not always generated. It might be caused by #2443 and #2496 does not fix the issue for sitemap generation.Here is the code that writes the sitemap file.
docusaurus/packages/docusaurus-plugin-sitemap/src/index.ts
Lines 38 to 43 in 6935b33
Writing the file is async, and the process might already be killed before it was able to write the file. To confirm my hypothesis, I changed
writeFiletowriteFileSyncand the problem seems to go away with my blog repo.Have you read the Contributing Guidelines on issues?
Yes.
To Reproduce
The bug is not reproducible on every repo. I cannot reproduce it on the docusaurus v2 project, but I managed to reliably reproduce it for my blog repo (at least on my machine).
yarnyarn workspace blog buildpackages/blog/build/sitemap.xmlThe file is empty.Expected behavior
sitemap.xmlis reliably generated.Actual Behavior
sitemap.xmlis not reliably generated.Your Environment
Reproducible Demo
(Paste the link to an example repo, including a
siteConfig.js, and exact instructions to reproduce the issue.)