juliancwirko / react-s-alert

Alerts / Notifications for React with rich configuration options
https://www.npmjs.com/package/react-s-alert
MIT License
649 stars 75 forks source link

React-s-alert not working in IE 11. #52

Open widdde opened 6 years ago

widdde commented 6 years ago

As far as I can see react-s-alert does not work in IE 11. Object.assign() is used in the code, and I don't think that is supported in ie11. Do you have a workaround for this? We want to use react-s-alert in our project but we need to support internet explorer 11.

Thanks in advance!

juliancwirko commented 6 years ago

Hi, have you tried it in IE11? I think it worked some time ago. But maybe I'm wrong, I haven't used IE11 for ages :/ I'll try to test it soon.

widdde commented 6 years ago

Hi! Yes, I have tried it and it is not working, it fails when trying to call Object.assign(). I know IE 11 is old but it is still heavily used (unfortunately). Many corporations is still stuck in ie 11.

Would be great if it can be fixed so it works in IE 11.

Thanks!

widdde commented 6 years ago

... React bootstrap table is also using react-s-alert internally when showing alerts and shows the same behavior in ie 11. The whole application fails because react-s-alert is trying to call Object.assign()..

juliancwirko commented 6 years ago

Of course it should work in IE 11 I just wonder how it worked previously ;) Object.assign should be transpiled by Babel, but maybe something is changed in that context.

widdde commented 6 years ago

Well, we are not using Babel in our project. (but maybe you do when compiling?) We're using webpack, and I thought webpack could polyfill this. We are writing ES6 syntax but it is compiled down to ES5 by webpack. Maybe I'm wrong, webpack maybe doesn't polyfill this, just compile down to es5? I don't see how this can work though. I was able to manually polyfill Object.assign() with the es6-object-assign package (found in npm). So now it is working for us, with a manual polyfill that is done globally in the project.

juliancwirko commented 6 years ago

I mean it should do this in the package, when building it. I'll try to make it work like that.

widdde commented 6 years ago

Looks like this bug is fixed in commit 48c10a9e4a0bc124a85c6b7b85a20c828943adf0, am I right? :) Close this issue?

Thanks for a fast fix!

juliancwirko commented 6 years ago

yup! It should be :)