Ant-design-pro: Android 安卓手机 QQ浏览器 打不开umi 搭建的项目 其他浏览器都行, 应该是国际化的问题

Created on 15 Jul 2020  ·  2Comments  ·  Source: ant-design/ant-design-pro

"umi": "^2.9.0",
"umi-plugin-locale": "^2.11.6",
"umi-plugin-react": "^1.15.8"

ie11
targets: {
ie: 11,
},
提示这个错误: 这个错误已经解决 #2149;

[React Intl] The Intl APIs must be available in the runtime, and do not appear to be built-in. An Intl polyfill should be loaded. #2149

但是 又出现新的错误提示

targets :ie9时 或 import '@babel/polyfill'; ...... 又报这个错误

21594777864_ pic

🛑 bug

Most helpful comment

需要单独引入intl这个包,并且在入口处引用

import 'intl';
import 'intl/locale-data/jsonp/en';
在src 下新建 global.js 加入上面的 内容就行

我自己回答这个问题 感谢 umi 大佬https://github.com/umijs/umi/issues/5036

在 antd pro 中还是无效

All 2 comments

这个估计要自己搞一下, target 不能解决所有的问题。
看看这里
https://github.com/formatjs/formatjs/wiki#getting-started

需要单独引入intl这个包,并且在入口处引用

import 'intl';
import 'intl/locale-data/jsonp/en';
在src 下新建 global.js 加入上面的 内容就行

我自己回答这个问题 感谢 umi 大佬https://github.com/umijs/umi/issues/5036

在 antd pro 中还是无效

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yaoleiroyal picture yaoleiroyal  ·  3Comments

zhuanglong picture zhuanglong  ·  3Comments

2uncle-code picture 2uncle-code  ·  3Comments

ghost picture ghost  ·  3Comments

yjz1004 picture yjz1004  ·  3Comments