Object.assign et al are not polyfilled
See original GitHub issueHi all,
Thanks for your wonderful work on this.
When testing a React app using create-react-app
on a old version of mobile Safari I noticed that Object.assign
was failing.
I looked and saw that polyfill support is turned off on the configuration of babel-plugin-transform-runtime
https://github.com/facebookincubator/create-react-app/blob/master/config/babel.prod.js#L33-L37
I worked around this by, for the moment, slightly inefficiently manually adding babel-polyfill
and using the more “traditional” import 'babel-polyfill';
at the root of the application to include core-js
polyfills.
Seems that if the goal is zero configuration setup this is going to be a gotcha for more than a few folks. Unsure if the best approach is to simply turn on the polyfill in babel-plugin-transform-runtime
as the documentation seems to suggest this is not the intent of this transformation to supplement native methods like Object.assign
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
I get exactly the same problem as mnemanja.
Version Info: C:\src\sandbox\react\my-app>create-react-app --version 1.4.0
Hi @gaearon, I’m at the script version 1.0.12 and IE11 reports this as a problem. Am I missing some implementation detail? Do I need to import it manually or something like that?
Cheers, Nemanja