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

Build script returns zero exit code due to unhandled promise rejection, non-zero exit code expected #805

Closed
hramos opened this issue Jun 26, 2018 · 0 comments
Assignees
Labels
better engineering Not a bug or feature request bug An error in the Docusaurus core causing instability or issues with its execution status: claimed Issue has been claimed by a contributor who plans to work on it.

Comments

@hramos
Copy link
Contributor

hramos commented Jun 26, 2018

It's possible for docusaurus build to encounter an error during a build, but the process returns a zero exit code. This causes systems like Circle CI to consider the build a success, and if your CI process happens to deploy automatically when tests are green, it could cause your website to go down.

Is this a bug report?

Yes

Have you read the Contributing Guidelines on issues?

Yes

Environment

"docusaurus": "^1.3.0"

Steps to Reproduce

  1. In an existing Docusaurus website, go ahead and delete an arbitrary markdown file from versioned_docs. To reproduce with https://github.com/facebook/react-native-website, delete versioned_docs/version-0.5/removing-default-permissions.md from master.
  2. Run docusaurus build

Expected Behavior

Docusaurus throws error due to improper sidebars file, returns non-zero exit code.

Actual Behavior

Docusaurus returns zero exit code, with the following output in the console:

Site built successfully. Generated files in 'build' folder.
(node:170) UnhandledPromiseRejectionWarning: Error: Improper sidebars file for version 0.56-RC, document with id 'version-0.56-RC-removing-default-permissions' not found. Make sure that all documents with ids specified in this version's sidebar file exist and that no ids are repeated.
    at _loop (/home/circleci/react-native-website/website/node_modules/docusaurus/lib/server/readCategories.js:58:17)
    at readCategories (/home/circleci/react-native-website/website/node_modules/docusaurus/lib/server/readCategories.js:34:53)
    at DocsSidebar.render (/home/circleci/react-native-website/website/node_modules/docusaurus/lib/core/DocsSidebar.js:18:26)
    at processChild (/home/circleci/react-native-website/website/node_modules/react-dom/cjs/react-dom-server.node.development.js:2204:18)
    at resolve (/home/circleci/react-native-website/website/node_modules/react-dom/cjs/react-dom-server.node.development.js:2061:5)
    at ReactDOMServerRenderer.render (/home/circleci/react-native-website/website/node_modules/react-dom/cjs/react-dom-server.node.development.js:2380:22)
    at ReactDOMServerRenderer.read (/home/circleci/react-native-website/website/node_modules/react-dom/cjs/react-dom-server.node.development.js:2354:19)
    at renderToStaticMarkup (/home/circleci/react-native-website/website/node_modules/react-dom/cjs/react-dom-server.node.development.js:2737:25)
    at renderToStaticMarkupWithDoctype (/home/circleci/react-native-website/website/node_modules/docusaurus/lib/server/renderUtils.js:16:30)
    at /home/circleci/react-native-website/website/node_modules/docusaurus/lib/server/generate.js:199:17
(node:170) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:170) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 36.38s.

Reproducible Demo

See yarn test in https://circleci.com/gh/facebook/react-native-website/1513

@endiliey endiliey added bug An error in the Docusaurus core causing instability or issues with its execution better engineering Not a bug or feature request labels Jun 27, 2018
@endiliey endiliey self-assigned this Jun 27, 2018
@endiliey endiliey added the status: claimed Issue has been claimed by a contributor who plans to work on it. label Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better engineering Not a bug or feature request bug An error in the Docusaurus core causing instability or issues with its execution status: claimed Issue has been claimed by a contributor who plans to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants