I have a react app. On Windows 10, it works fine on Chrome and Internet Explorer 11. But on Windows 7, it only works on Chrome, not internet explorer 11.
I get the below error:
SCRIPT438: Object doesn't support property or method 'assign'
through my research this looks like a patibility issue with IE 11 (although not sure why it works on windows 10).
As far as I'm aware, something about polyfill/transfill(?)/babel needs to be used. But here is the bit I have the biggest issue with:
i have a bundle.js file that contains all the site code. this is a mixture of my own code, and NPM node modules. If the issue was with my code, then I'm fine with adding an import line and changing my code. but the error es from the npm node modules. I can't edit these files. How can I resolve this Object.assign issue without touching those files?
I'm not really familiar with browser patibility stuff so I'm quite stuck
Any advice?
I have a react app. On Windows 10, it works fine on Chrome and Internet Explorer 11. But on Windows 7, it only works on Chrome, not internet explorer 11.
I get the below error:
SCRIPT438: Object doesn't support property or method 'assign'
through my research this looks like a patibility issue with IE 11 (although not sure why it works on windows 10).
As far as I'm aware, something about polyfill/transfill(?)/babel needs to be used. But here is the bit I have the biggest issue with:
i have a bundle.js file that contains all the site code. this is a mixture of my own code, and NPM node modules. If the issue was with my code, then I'm fine with adding an import line and changing my code. but the error es from the npm node modules. I can't edit these files. How can I resolve this Object.assign issue without touching those files?
I'm not really familiar with browser patibility stuff so I'm quite stuck
Any advice?
Share Improve this question asked Jul 20, 2017 at 2:24 user3120554user3120554 7032 gold badges12 silver badges22 bronze badges2 Answers
Reset to default 2The best long-term/munity-friendly solution might be to identify which module is causing the problem and to file an issue with the maintainer(s) of the module. But if you need an immediate fix or if you can't figure out which module is causing the problem, you can try including an Object.assign polyfill before the offending module loads.
A polyfill is a piece of code that manually defines a feature (like Object.assign) for browsers that don't already support a given feature. In this case, you could include something like this module, either by importing it into your bundle before the other modules, or by downloading and serving that polyfill file and loading it with a <script>
tag in your HTML document before you load your bundle.js file. This way, Object.assign will be defined by the polyfill before your browser es across the module code that calls Object.assign.
Another work around for peeps using 'create-react-app' and can't access the webpack config files, follow the following steps:
npm i babel-polyfill
and then :
// index.jsx import 'babel-polyfill';
Here is a good article over this approach.