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

Ensure the worker processes do not crash when parsing invalid syntax #209

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Apr 6, 2022

The original code never handled the cases where @babel/core's transform method throws an error, it just happened to be that we didn't hit this case (because babel tended not to throw during parsing).

This updates to ensure that our worker will always resolve, sometimes with { code, metadata } and other times (when an error happens) { error, stack }. When we resolve with { error, stack } the parent process will throw an error with that information (so that ember build exits non-zero, or ember serve shows the build failure and then rebuilds succesfully once the syntax error is fixed).

@rwjblue rwjblue added the bug label Apr 6, 2022
The original code **never** handled the cases where `@babel/core`'s
`transform` method throws an error, it just _happened_ to be that we
didn't hit this case (because babel tended not to `throw` during
parsing).

This updates to ensure that our worker will always resolve, sometimes
with `{ code, metadata }` and other times (when an error happens)
`{ error, stack }`. When we resolve with `{ error, stack }` the parent
process will throw an error with that information (so that `ember build`
exits non-zero, or `ember serve` shows the build failure and then
rebuilds succesfully once the syntax error is fixed).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant