简体   繁体   English

预期使用IE11 Script1003:

[英]IE11 Script1003 expected :

I am trying to add support for IE11. 我正在尝试添加对IE11的支持。 I get the errors: 我得到了错误:

SCRIPT1003: Expected ':' 脚本1003:预期的':'

File: vendor.bundle.js, Line: 8699, Column: 8 文件:vendor.bundle.js,行:8699,列:8

SCRIPT5009: 'webpackJsonp' is undefined SCRIPT5009:“ webpackJsonp”未定义

File: app.bundle.js, Line: 1, Column: 1 文件:app.bundle.js,行:1,列:1

Line 8699 throws at this: 8699行在此抛出:

style(props, propName, componentName) {
  if (props[propName] == null) {
    return undefined;
}

It seems as though babel isn't transpiling this Object Initializer to style: (props, propName, componentName) . 似乎babel并未将此Object Initializer转换style: (props, propName, componentName)

package.json: 的package.json:

"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.0.0",
"babel-plugin-istanbul": "^4.1.4",
"babel-plugin-relay": "^1.4.1",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.18.0",

.babelrc .babelrc

{
  "presets": [
    "env",
    "stage-2",
    "react"
  ],
  "plugins": [
    "relay"
  ],
}

webpack.js: webpack.js:

{
  test: /\.jsx?$/,
  include: [
    path.resolve(__dirname, 'wwwroot/components'),
  ],
  loader: 'babel-loader',
},

I presume the second error is being caused by the first. 我认为第二个错误是由第一个引起的。

Edit: 编辑:

Full error code: 完整错误代码:

var _StyleValidator = __webpack_require__(1396);

var _StyleValidator2 = _interopRequireDefault(_StyleValidator);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var styleValidator = exports.styleValidator = new _StyleValidator2.default();

function configStyleValidator(config) {
  styleValidator.setConfig(config);
}

exports.default = {
  style(props, propName, componentName) {
    if (props[propName] == null) {
      return undefined;
    }

    for (var _len = arguments.length, rest = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
      rest[_key - 3] = arguments[_key];
    }

    var objErr = _propTypes2.default.object.apply(_propTypes2.default, [props, propName, componentName].concat(rest));
    if (objErr) {
      return objErr;
    }
    return styleValidator.validate(props[propName], componentName);
  }
};

原来这是一个针对节点而不是浏览器的软件包导入,在我的情况下,它是react-html-email: https : //github.com/chromakode/react-html-email/issues/51

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM