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
JSXSpread error filling terminal with non-useful debug information #5492
Comments
Hey @cdubois-mh! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
To spread an array you need to use: [ ...actions ] This isn't an issue in Babel. The error come from the object spread of an array passed to JSX. As far as I remember you could directly use the <div className="alert-actions">
{ actions }
</div> |
Pretty sure the issue is that the OP is saying we should have a "better" error message if you accidentally type |
Like @hzoo mentioned, I was talking about what the error message displays.
In my post, I clearly stated that I already knew how to fix the error. |
Yep, this isn't really a high priority but definetely something we should do (I'm usually in favor of better error messages in general, although the tradeoff is a slower parse usually). |
bug
When the spread operator is miss-used, the compiler goes crazy and doesn't give the developper any hint on why something went wrong.
Inside a react es6 class, I was trying to render an array of jsx elements as follow:
I already know that I should've written
{ actions }
and not{ ...actions }
.I got an incredible load of errors that filled my terminal from babel compiler, the first error message being
I would expect some error message telling me in which file, line and column the unrecognized JSXSpreadChild operator was found. In a huge project, without those critical information, it's way too hard to debug.
I'm using React 15.2.0 ( npm ) and babel-runtime 6.23.0
in meteor.
The text was updated successfully, but these errors were encountered: