mifi / react-lottie-player

Fully declarative React Lottie player
MIT License
505 stars 53 forks source link

It completely breaks App in IE11 (using Light) #49

Open edoTGTG opened 3 years ago

edoTGTG commented 3 years ago

It'll throw a "SCRIPT1004: Expected ';' ". Very likely to be because of a FOR...IN loop https://stackoverflow.com/questions/55025430/script1004-expected-occuring-in-for-loop-ie-browser

Also, the Light package includes React 16... Why is that?

Thanks!

mifi commented 3 years ago

Im not sure where in the code there is a for-in. Can you please elaborate? Also where do you see that react 16 is included? If you see package.json react16||17 is a peer dependency so it is not included. IE11 is not really high priority to support but if it’s an simple fix im open for a PR.

edoTGTG commented 3 years ago

node_modules/react-lottie-player/dist/LottiePlayerLight.js

Line 14 for (var key in source) {

Line 46 `/** @license React v16.13.1

mifi commented 3 years ago

Are you using create-react-app? If so, see here for how to add support for ie11: https://stackoverflow.com/questions/55967048/how-do-i-support-ie-11-with-create-react-app-3-0

As for why react is included in the dist, I'm looking into that.

edoTGTG commented 3 years ago

Unfortunately not, we have an "old" app from 2 years ago, built the regular way. Lottie unfortunately is the only breaking our solution on IE11. Not even the latest react 17.0.2 does :/

mifi commented 3 years ago

Oh I see. But does normal lottie-web without react-lottie-player work in IE11?

edoTGTG commented 3 years ago

Good question. I saw that they are supposedly supporting it, but opening lottiefiles.com on IE11 shows no animations and some errors.

mifi commented 3 years ago

If you can make lottie-web work on IE11, but reqct-lottie-player fails, then we can look into what’s causing it.

edoTGTG commented 3 years ago

I setup a pen and tested it on IE11. It works flawlessly when using Lottie light from their CDN https://codepen.io/edotgtg/pen/BaZeONa