【问题标题】:redux-observable not exported createEpicMiddlewareredux-observable 未导出 createEpicMiddleware
【发布时间】:2017-02-14 18:15:15
【问题描述】:

我在 Ionic2 rc0 中使用 redux-observable 并遇到错误,知道吗?

Error: Module /Volumes/data/test/node_modules/redux-observable/lib/index.js does not 
export createEpicMiddleware (imported by /Volumes/data/test/.tmp/store/index.js)

【问题讨论】:

    标签: redux-observable


    【解决方案1】:

    我已经很多年没有使用过 Ionic,但快速浏览一下 Ionic 问题跟踪器就会发现这与 Rollup 相关并且影响了许多第三方库。

    ionic#8322 包含许多有关此问题的示例,并且看起来它随后移至 ionic-app-scripts#68 和最新的 conclusions appearing to be here

    如果你发现 redux-observable 的末端有什么东西,我们可以做的更简单,请告诉我们!我们在包装中包含maintain a TypeScript definition

    作为一种临时解决方法,您可能可以通过以下方式直接访问该文件:

    import { createEpicMiddleware } from 'redux-observable/lib/createEpicMiddleware';
    
    // note the path! reaching into lib directly
    

    但它可能不起作用,因为我怀疑 TypeScript 会将这个文件与我们的 index.d.ts 中的类型定义相关联。

    【讨论】:

    • 现在它说错误 TS2307: 找不到模块 'redux-observable/lib/createEpicMiddleware'。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-24
    • 2019-03-01
    • 1970-01-01
    • 2018-03-19
    • 2019-10-24
    • 1970-01-01
    • 2018-10-15
    相关资源
    最近更新 更多