导入 mobx-state-tree 抛出 Uncaught TypeError: Object(...) is not a function

时间:2021-01-22 00:24:36

标签: javascript node.js mobx

import { types } from "mobx-state-tree";

抛出错误

mobx-state-tree.module.js:2354 Uncaught TypeError: Object(...) is not a function
    at CoreType.BaseType (mobx-state-tree.module.js:2354)
    at CoreType.SimpleType [as constructor] (mobx-state-tree.module.js:2554)
    at new CoreType (mobx-state-tree.module.js:6418)
    at Module.<anonymous> (mobx-state-tree.module.js:6491)
    at Module../node_modules/mobx-state-tree/dist/mobx-state-tree.module.js (mobx-state-tree.module.js:8319)
    at __webpack_require__ (bootstrap:19)
    at Module../js/app.js (app.js:1)
    at __webpack_require__ (bootstrap:19)
    at Object.0 (global.js:20)
    at __webpack_require__ (bootstrap:19)

这是为什么?我所做的只是导入。

版本是5.0.0

1 个答案:

答案 0 :(得分:0)

我不得不将 mobx 从版本 5 更新到版本 6