[React Intl] Missing locale data for locale: “undefined”. Using default locale: “en” as fallback
IE10报错
[React Intl] TheIntlAPIs must be available in the runtime, and do not appear to be built-in. AnIntlpolyfill should be loaded
参考资料
https://github.com/ant-design/ant-design-pro/issues/2149
Intl 自己的polyfill. https://formatjs.io/guides/runtime-environments/
react项目的主入口文件中引入
import 'intl';
import 'intl/locale-data/jsonp/en';
intl是从这里来的,https://github.com/andyearnshaw/Intl.js
polyfill.js添加
参考 https://github.com/ant-design/ant-design-pro/issues/2644
npm install --save intl @babel-polyfill
use
import '@babel/polyfill';
global.Intl = require('intl'); // 适配 nodejs
window.Intl = require('intl'); // 适配浏览器