-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Fragments in IE11 rendered as strange elements #13414
Comments
Is it possible that you load See #8379 (comment) for a similar problem. You can search for |
Thanks for your reply. I'm getting somewhere with this now. After deconstructing my app bit-by-bit, the surprising cause of this appears to be... Google Maps! I'm loading the Google Maps JavaScript API with a script tag, then loading my bundled app with another script tab. If I reverse these, it works. It looks like the Google Maps API includes a Symbol polyfill of its own which is somehow confusing things. I'm still none the wiser as to why though as after looking at the lines of code you suggested I'm even more confused... There are three instances that I can see where React libraries (react, react-dom, and react-is) are checking for
So irrespective of whether Google Maps is loaded first, last, or not at all the bundled application and all of the React libraries appear to use the same core-js polyfill of Symbol. So why this is an issue at all is a mystery to me, as is why loading Google Maps first has any influence over it. Also, since you mentioned it, and just in case the Google Maps thing is a red herring, I'm pretty sure I'm loading babel-polyfill before everything else by having the following in my webpack config: entry: [
'babel-polyfill',
path.resolve(__dirname, 'src/index.js') /* my entry point */
] As far as I'm aware, this will load the polyfill before anything else. Thanks again. |
If you can reduce it to a reproducible example (now that you know it has something to do with Google Maps) I can take a look. |
Thanks! I think I've got it down to its bare bones here: You should be able to just run If you then reverse the script tags in index.html (so Google Maps is loaded last) then the weird tag never appears in the first place! |
Thanks. I won't have time to dig into this in close future but I'll leave this for somebody motivated. |
have dealt with this same issue in InstantSearch.js (we were using preact), and the fix was this: preactjs/preact-compat#423 |
We do check for |
The problem is that core-js polyfill for |
As @sanniassin pointed out, the Google Maps polyfill is causing |
Jeez. Okay. Can we report it to them? |
I had the same issue before and I solved it by fixing the version of Google Maps |
Do you mean a newer version fixes it? Or an older one? |
Unfortunately older one |
Seems to be an issue with the Symbol polyfill implementation from the Closure compiler, see Sam Saccone's tweet |
I filed google/closure-compiler#3052. I don't think we'll be adding more "bad Symbol polyfill" checks — IMO something that GCC should fix. |
According to google/closure-compiler#3052 (comment), one workaround would be to ensure that |
Thanks, that's what I ended up doing. My bundled app is the first script to run, so core-js gets to install its polyfill first. Adding the Google Maps library is also now done with the load-google-maps-api library to ensure it's done within the polyfilled app but before the parts of the app that use it. Works well. Thanks for all of your help with this. |
This is an exotic one. In IE11, in the toolbar markup, you can briefly see the appearance of a new HTML element called `<jscomp_symbol_react.fragment16>`. This is obviously not a real element, but it is rendered by IE11 as a real element, which means it breaks the flexing of the actual children of the toolbar. This PR _styles_ that temporary element, to at least not be broken. This is an ugly workaround to an upstream React issue reported here: facebook/react#13414
Many thanks to all. I'm using ReCaptcha from Google and I had the same. When I moved the recaptcha script call AFTER my bundle.js, everything went just fine. |
|
React / ReactDOM: 16.4.2
I'm having trouble reproducing this, but I'm raising it in the hope that someone can give me some clues as to the cause. I have a large application which is using
Fragment
in a few places, like so:In everything but Internet Explorer, this renders as you'd expect:
However, for some reason in Internet Explorer 11, these are being rendered as some weird tags:
I've tried pausing the code at the transpiled
_react.createElement(_react.Fragment)
line, and the_react.Fragment
export is a string with the same name as the tag (jscomp_symbol_react.fragment16
). I think this is just the correct way in which the symbol polyfill works and that React should recognize it as something other than an HTML tag.What's even weirder is that this only happens sometimes. If two components in my app are using fragments, the first one to render may have the above issue, the second may not. If an affected component re-renders, the rendered DOM will be corrected. I haven't found a solid pattern to this yet.
I have a fairly typical webpack + babel setup, and using the babel-polyfill for symbol support. I'm really not sure what parts of my setup are relevant to this so please let me know if you need any extra info. Again, I'm trying to create a reproduction outside of my application but if anyone can offer me some clues in the meantime I'd be incredibly grateful.
The text was updated successfully, but these errors were encountered: