-
Notifications
You must be signed in to change notification settings - Fork 103
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
IE 11 Syntax Error starting in version 1.20.0 #124
Comments
Hmm. :\ I wouldn't think that should make a difference, but I'm not sure. What exactly is the syntax error you're getting? Can you share/copy it, or screenshot it or something? It's possible that the upgrade from I don't see anything in the changeset between those two versions that seems like a smoking gun, on the surface, as far as this lib's actual source code, but I'm happy to try to help support, if I can, if you can provide the add'l info? |
Thanks for the reply. We get a helpful SCRIPT1002: Syntax Error. I realize this isn't greatly helpful. When I force npm back to 1.19.1 the syntax error stops being an issue. Our JSX looks like this: const ParserTest = props => {
return (
<>
<p>Parser test</p>
<JsxParser
components={{ ComponentA, ComponentB, }}
jsx={`<span>
Here is our JSX
<ComponentA />
<ComponentB />
</span>
`}
/>
</>
);
}; |
@davidprovan - not sure if this is just an error with your example, or if it's actually reflective of your code - but what you pasted isn't valid JSX. Valid JSX would be something like:
Note the Can you confirm? My suspicion is that if you've got the That's equivalent to the following:
Which won't compile. Instead, you need at least a Fragment inside.
|
Yeah that's an error on my part when I pasted into the git hub comments we are using the String literals, apologies. Fixing original comment now. |
Commented edited @TroyAlford , please accept my apologies, I was used to GitLab markdown. This JsxParser code works great in Chrome, Firefox etc... Just IE11 throws that syntax error. |
Ouch. :\ @davidprovan - can you create a minimal reproduction of this, and upload it as a zip or a repo that I can run locally, to see if I can figure out what's up? |
Given the lack of response, here, I'm going to close this ticket. Please feel free to comment again and re-open if there is still something here to look at. |
Commenting because this is an issue I have as well. IE11 and newer versions of See: acornjs/acorn-jsx#98 |
Hi :) Part of chunk.js where IE found the syntax error:
I have also tried to transpile ancornJsx with babel, but unfortunately it didn't work
|
Hm. I reopened the issue, since there are new reports of this. Is this IE11, I assume? Or are you also seeing this in Edge and higher? It seems reasonable to transpile |
On Edge everything is perfectly fine :) I'm not sure but maybe react-responsive-carousel has similar issue: leandrowd/react-responsive-carousel#439 |
* Fixes #124: add es5 build * Bump all dependencies
I think the latest will resolve this. I am going to look at the other recent issues before publishing - but the new version will contain a I work on a mac, so I haven't tested this in any real use cases - but I'll be happy to re-open and do some more with it if folks continue to see issues. |
This is now released as 1.25.1. As updated in the README, please import from |
Now it is perfectly working on IE 11 !! :) |
My pleasure :) Glad it helped out. |
Updating to say it solved my issue, too. Thank you!! |
Hey,
I have been debugging an issue with our project for the last day or two where we had issue's rendering on IE 11 (I know I know but Windows still supports it).
When we downgrade to explicitly use 1.19.1 we work great on IE 11 and when we upgrade to 1.20.0 or higher we get a syntax error in our vendors.js generated by webpack. Is there anything particular in that changeset which would have adversely affected IE 11?
I looked through the changeset comparing 1.20.0 with 1.91.1 and wondered if the acorn multiline addition could have thrown IE11 for a whirl?
Thanks for any advice or thoughts.
David
The text was updated successfully, but these errors were encountered: