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

fix(babel-plugin-component): improve error reporting #3912

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

nolanlawson
Copy link
Collaborator

@nolanlawson nolanlawson commented Dec 19, 2023

Details

If an error is thrown within the Babel plugin itself (e.g. caused by #3910), you get a very unhelpful error because err.filename is undefined below, and so it fails when you try to path.basename it.

The resulting error is still not very helpful (and we should address #3910 to resolve that), but this PR makes it so you at least don't get a totally unrelated error message.

I do not believe it's worth adding tests for this, because any error thrown by the plugin is a bug that should be fixed eventually, so any test we write will quickly become stale.

Does this pull request introduce a breaking change?

  • ✅ No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • ✅ No, it does not introduce an observable change.

@nolanlawson nolanlawson requested a review from a team as a code owner December 19, 2023 22:53
Copy link
Member

@jmsjtu jmsjtu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@nolanlawson nolanlawson merged commit 293d5ad into master Dec 20, 2023
9 checks passed
@nolanlawson nolanlawson deleted the nolan/babel-guard branch December 20, 2023 00:39
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.

2 participants