Skip to content
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

fix(v2): Use writeFileSync to write generated sitemap.xml to avoid early termination #2530

Merged
merged 1 commit into from
Apr 5, 2020
Merged

fix(v2): Use writeFileSync to write generated sitemap.xml to avoid early termination #2530

merged 1 commit into from
Apr 5, 2020

Conversation

SamChou19815
Copy link
Contributor

Fix #2516.

Without a synchronous write, the callback may never be invoked because it's killed by process.exit introduced in #2443.

Motivation

Unbreak sitemap generation.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Since I wasn't able to produce a repro for the docusaurus repo but I was able to repro it on my repo (see #2516), so I made the test against my repo.

  1. Run yarn to compile all files.
  2. Copy generated packages/docusaurus-plugin-sitemap/lib/index.js into correct place in https://github.com/SamChou19815/website 's node_modules
  3. Run yarn workspace blog build in https://github.com/SamChou19815/website, now the sitemap is correctly generated.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 4, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 83a5146

https://deploy-preview-2530--docusaurus-2.netlify.com

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Sam!

@yangshun yangshun merged commit 4645235 into facebook:master Apr 5, 2020
@yangshun yangshun added the pr: bug fix This PR fixes a bug in a past release. label Apr 5, 2020
@SamChou19815 SamChou19815 deleted the site-map-write-file-sync branch April 5, 2020 04:27
@lex111 lex111 added this to the v2.0.0-alpha.51 milestone Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2: Sitemaps are not always generated
5 participants