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

Do not crash on syntax errors #163

Open
cpojer opened this issue May 13, 2024 · 2 comments
Open

Do not crash on syntax errors #163

cpojer opened this issue May 13, 2024 · 2 comments

Comments

@cpojer
Copy link
Contributor

cpojer commented May 13, 2024

Vocs currently crashes when it discovers syntax errors in:

  • MDX files
  • CSS files
  • Maybe others?

This can be observed by saving a file with a syntax error while the vocs server is running. Instead of showing an error on the client, it will usually crash instead. Ideally it should never crash like Vite itself.

@cpojer
Copy link
Contributor Author

cpojer commented May 13, 2024

Correction, it does not always crash when there are syntax errors in MDX files, but it does happen. I'll share concrete repros when I run into them.

@cpojer
Copy link
Contributor Author

cpojer commented May 13, 2024

Example crash in an MDX file. I was typing out the style prop in a div, and I saved in the following state:

<div style={{mar}}>
  Text
</div>
/docs/content/pages/index.mdx:56
          mar
          ^

ReferenceError: mar is not defined

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

No branches or pull requests

1 participant