admin管理员组文章数量:1405984
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.
本文标签: javascriptreact app issues running on internet explorer 11Stack Overflow
版权声明:本文标题:javascript - react app: issues running on internet explorer 11 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744967485a2635036.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论