React-app-rewired: When react-app-rewired run with babel-polyfill, 'Set' is not defined in IE10.

Created on 28 Mar 2018  路  4Comments  路  Source: timarney/react-app-rewired

I use react-app-rewired in my project, like this:

const { injectBabelPlugin } = require('react-app-rewired');

module.exports = config => injectBabelPlugin(['import', {
    libraryName: 'antd',
    libraryDirectory: 'es',
    style: 'css'
}], config);

and in my webpack entry file, I use babel-polyfill:

import 'babel-polyfill';

after npm run build... I get my project.
when I run my project in ie10, I get an error : "Set" is not defined.
I think babel-polyfill can not work in now, but I can't understand. How about it?

Most helpful comment

Try this in config-overrides.js:

config.entry.unshift(
  'babel-polyfill'
);

All 4 comments

Don't know on this one and can't offer debug support as my time is limited. Given your ie10 requirement you might be better off using eject.

Oh, thanks.

Try this in config-overrides.js:

config.entry.unshift(
  'babel-polyfill'
);

@froston Thanks! This works for me.
I have a browser capability problem with IE11, it can't support String.prototype.startswith method, this can fix it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tobbe picture Tobbe  路  5Comments

Yegair picture Yegair  路  5Comments

lyudad picture lyudad  路  6Comments

zhihongzhong picture zhihongzhong  路  4Comments

InsOpDe picture InsOpDe  路  5Comments