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
Syntax JSX: Property name of JSXOpeneningElement expected node to be of a type ["JSXIdentifier", "JSXMemberExpression"] but instead got "MemberExpression". (T6976) #3994
Comments
Hello @eccentric_j.
I can't imagine anyone is going to be willing to attempt to debug this without sample input that triggers it (I know I'm not). In fact, a //minimal// runable reproduction would be best. If you need help getting started you can check out https://github.com/miniminirepro/babel. |
@jmm Ah that makes total sense. Here is the repro repo https://github.com/jayzawrotny/minirepro-babel-syntax-jsx-error. Fortunately I was able to boil it right down to a very specific case with a minimal set of code. |
@eccentric_j thanks, that's a great start, but
|
@jmm Eeek I thought, "It's cool I got this." Clearly I do not :P Anyway, I have made the requested changes & double cloned the repro and ran it to ensure it works. Good call on the stage-0. I wanted to recreate the exact settings I was using but forgot to rule it out so it too has been removed. |
@eccentric_j Thanks for the updated repo. I'm now able to reproduce, though the input code can be trimmed by 96%. This is a result of importing to an identifier that's used as a JSX identifier, e.g.:
Please update your repo with a |
Ok, I pushed up a dist/expected.js and I made my best guess for what the output should look like. |
Any progress on this? Or instructions for how to work around it, or a known stable version where it doesn't occur? We just tried upgrading to Babel 6.x, and this is blocking us. |
Ah, looks like |
@jayzawrotny The |
I added |
Ok closing |
Bug information
Options
Input code
Description
The intention was to be able to parse a JSX file but not transform it. However, the following error occurs when babel is transforming my source file. A temporary workaround was to use transform-react-jsx where no error is thrown. While this solution works for now it slows down my module significantly having to transform the JSX for several hundred files.
If the JSX source is needed I can supply it but it's been happening with multiple JSX files which is what convinces me it has more to do with the babel plugin than my source code.
The text was updated successfully, but these errors were encountered: