![](/img/trans.png)
[英]Polyfill not working on IE11, shows SCRIPT1003 Expected “:”
[英]IE11 Script1003 expected :
我正在嘗試添加對IE11的支持。 我得到了錯誤:
腳本1003:預期的':'
文件:vendor.bundle.js,行:8699,列:8
SCRIPT5009:“ webpackJsonp”未定義
文件:app.bundle.js,行:1,列:1
8699行在此拋出:
style(props, propName, componentName) {
if (props[propName] == null) {
return undefined;
}
似乎babel並未將此Object Initializer轉換為style: (props, propName, componentName)
。
的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
{
"presets": [
"env",
"stage-2",
"react"
],
"plugins": [
"relay"
],
}
webpack.js:
{
test: /\.jsx?$/,
include: [
path.resolve(__dirname, 'wwwroot/components'),
],
loader: 'babel-loader',
},
我認為第二個錯誤是由第一個引起的。
編輯:
完整錯誤代碼:
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.