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

Syntax error causes yarn start to exit #2449

Closed
ianschmitz opened this issue Mar 23, 2020 · 1 comment
Closed

Syntax error causes yarn start to exit #2449

ianschmitz opened this issue Mar 23, 2020 · 1 comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@ianschmitz
Copy link

🐛 Bug Report

Accidentally introducing a syntax error in JSX code causes yarn start to exit completely. This is unexpected coming from other tools such as CRA, Next.JS, etc.

Have you read the Contributing Guidelines on issues?

👍

To Reproduce

  1. yarn start
  2. Introduce syntax error in JSX code within a mdx or js file
  3. Save file
  4. Observe error and subsequent exit of start script

Expected behavior

Watch mode continues to work, and fixing the error recovers correctly.

Actual Behavior

Client bundle compiled with errors therefore further build is impossible.
./docs/mobile/change-default-behaviour.mdx
Module build failed (from ./node_modules/@docusaurus/mdx-loader/src/index.js):
SyntaxError: unknown: Unexpected token (56:43)

  54 |         title="Commands and Operations"
  55 |         description="Learn more about commands and operations"
> 56 |         link="concepts-commands-operations",
     |                                            ^
  57 |     />
  58 |     <UseCaseCard
  59 |         title="Change Geocortex Mobile's Default Search Behaviour"
    at Object._raise (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:742:17)
    at Object.raiseWithData (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:735:17)
    at Object.raise (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:729:17)
    at Object.unexpected (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:8757:16)
    at Object.jsxParseIdentifier (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4388:12)
    at Object.jsxParseNamespacedName (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4398:23)
    at Object.jsxParseAttribute (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4482:22)
    at Object.jsxParseOpeningElementAfterName (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4503:28)
    at Object.jsxParseOpeningElementAt (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4496:17)
    at Object.jsxParseElementAt (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4528:33)
    at Object.jsxParseElementAt (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4544:32)
    at Object.jsxParseElementAt (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4544:32)
    at Object.jsxParseElement (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4602:17)
    at Object.parseExprAtom (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:4609:19)
    at Object.parseExprSubscripts (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:9602:23)
    at Object.parseMaybeUnary (/home/ian/Code/dev-center/node_modules/@babel/parser/lib/index.js:9582:21)
 @ ./.docusaurus/registry.js 1:2379-2448 1:2182-2329
 @ ./node_modules/@docusaurus/core/lib/client/exports/ComponentCreator.js
 @ ./.docusaurus/routes.js
 @ ./node_modules/@docusaurus/core/lib/client/clientEntry.js
 @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./node_modules/@docusaurus/core/lib/client/clientEntry.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Your Environment

  • Docusaurus version used: 2.0.0-alpha.48
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Node 12.13.0
  • Operating system and version (desktop or mobile): Ubuntu 19.10
@ianschmitz ianschmitz added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Mar 23, 2020
@lex111
Copy link
Contributor

lex111 commented Mar 23, 2020

This is already fixed in #2437

@lex111 lex111 closed this as completed Mar 23, 2020
@yangshun yangshun removed the status: needs triage This issue has not been triaged by maintainers label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

3 participants