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

[static-build] Fix error handling for unexpected output directory #4727

Merged
merged 4 commits into from
Jun 27, 2020

Conversation

styfle
Copy link
Member

@styfle styfle commented Jun 26, 2020

This PR improves the error handling when a zero config framework has an unexpected output directory.

Previously, setting a Docusaurus 2.0 build command to docusaurus build && mv build foo would fail with the following:

Error: ENOENT: no such file or directory, scandir '/vercel/514ce14b/build'

With this PR, the error message will show the expected:

Error: No Output Directory named "build" found after the Build completed. You can configure the Output Directory in your project settings. Learn more: https://vercel.com/docs/v2/platform/frequently-asked-questions#missing-public-directory

I also changed the usage of promisify(fs) to fs.promises which is available in Node 10 or newer.

Lastly, I updated the test suite to check if the correct error message is returned for builds we expect to fail.

TooTallNate
TooTallNate previously approved these changes Jun 26, 2020
@styfle styfle requested a review from TooTallNate June 26, 2020 22:15
@styfle styfle changed the title [static-build] Add error handling for unexpected output directory [static-build] Fix error handling for unexpected output directory Jun 26, 2020
@styfle styfle merged commit a7bef93 into master Jun 27, 2020
@styfle styfle deleted the ch1406/docusaurus branch June 27, 2020 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants