babel-plugin-transform-object-assign或babel-polyfill?

时间:2018-04-11 06:54:01

标签: internet-explorer webpack internet-explorer-11 babel mobx-state-tree

我正在使用webpack 4,mobx状态树和babel。当我运行mobx状态树时,我在IE 11上收到此错误

{exception} Object doesn't support property or method 'assign'
in mobx-state-tree.module.js

   var name = opts.name || defaultObjectOptions.name;
        // TODO: this test still needed?
        if (!/^\w[\w\d_]*$/.test(name))
            fail("Typename should be a valid identifier: " + name);
        **Object.assign(_this, defaultObjectOptions, opts);**
        // ensures that any default value gets converted to its related type
        _this.properties = toPropertiesObject(_this.properties);
        freeze(_this.properties); // make sure nobody messes with it
        return _this;
    }
stack "TypeError: Object doesn't support property or method 'assign'\n at ModelType$$1 (eval code:3080:9)\n at model$$1 (eval code:3349:5)\n at eval code (eval code:9:1)\n at ./src/stores/AppStore.js (http://localhost:8080/index_bundle.js:2136:1)\n at __webpack_require__ (http://localhost:8080/index_bundle.js:710:12)\n at fn (http://localhost:8080/index_bundle.js:95:13)\n at eval code (eval code:9:1)\n at ./src/stores/Stores.js (http://localhost:8080/index_bundle.js:2148:1)\n at __webpack_require__ (http://localhost:8080/index_bundle.js:710:12)\n at fn (http://localhost:8080/index_bundle.js:95:13)"

我不确定我是否应该使用babel pollyfillbabel transform或其他不同的东西。

0 个答案:

没有答案
相关问题