-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Error messages are not helpful #104
Comments
Latest 6to5 doesn't use esprima. Can I have some steps to reproduce and the browserify command and node/6to5 version? |
Hm, I just realized that this must be coming from
This halts at the first class definition it encounters. Browserify is usually good at reporting the right location, but not in this case. (Browserify 4.2.3.) |
It'd likely be coming from another of your browserify transformers, I looked at all the ones listed and all of them appear to use esprima-fb which is bleeding-edge esprima and contains ES6 support. Also 6to5-browserify doesn't appear in your command so how is it being ran? 6to5 actually comes with a jsx and react transformer so you actually don't need to use reactify at all. |
I didn't know that 6to5 had those transformers. Thanks. It was just an example that will fail on the first transformer, the complete line would be:
Is there anything I need to do to make 6to5-browserify look at .jsx files? Because if I do just:
then ES6 syntax in .js will be correctly transpiled, but not .jsx files. Hang on, your JSX transformer requires the |
No it doesn't require that annotation, it'll automatically default to it. 6to5-browserify will transform whatever file it's given so there's no reason that it shouldn't work given the |
Just run a test with the command |
I had managed to upgrade 6to5 but not 6to5-browserify, and it was a couple of patch versions behind. That was all. Sorry, and thanks for the help! By the way, I think your JSX annotation check is too strict: var JSX_ANNOTATION_REGEX = /^\*\s*@jsx\s+([^\s]+)/; Facebook's sources seem to use two asterisks: /** @jsx React.DOM */ |
No problem! That regex actually exactly matches that comment, it's ran against the actual contents. |
D'oh. Of course. |
* exact object type annotations for Flow plugin * Couple tweaks per suggestions * s/==/===/ * add test for unexpected token in flowObjectType Semicolon
Not sure if this is 6to5 or 6to5-browserify. At any rate, errors in processed files are reported with no information about the file; this is what I get:
As you can guess, it's pretty hard to determine where the error is coming from.
The text was updated successfully, but these errors were encountered: