我正在尝试为 IE11 填充项目,但无论我做什么,浏览器都会记录这些错误:
开发模式:
SCRIPT1002:_app.js 中的语法错误 (49004,30)
49004 const Component = props => (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_injectIntl__WEBPACK_IMPORTED_MODULE_2__["Context"].Consumer, null, intl => {
Object(_utils__WEBPACK_IMPORTED_MODULE_1__["invariantIntlContext"])(intl);
const formattedValue = intl[name](props.value, props);
if (typeof props.children === 'function') {
return props.children(formattedValue);
}
const Text = intl.textComponent || react__WEBPACK_IMPORTED_MODULE_0__["Fragment"];
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](Text, null, formattedValue);
}));
Run Code Online (Sandbox Code Playgroud)
建造模式:
SCRIPT1006: 应为 ')'
...function G(e,t,n={})
Run Code Online (Sandbox Code Playgroud)
NextJS doc 说框架 polyfills 中的代码,但这还不够。那还缺什么?
.babelrc
{
"env": {
"development": {
"plugins": [
[
"react-intl",
{
"messagesDir": "./lang/.messages/"
}
]
],
"presets": [
[
"next/babel",
{
"@babel/preset-env": {
"useBuiltIns": …Run Code Online (Sandbox Code Playgroud)