2

我正在使用 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或其他不同的东西。

4

0 回答 0