【问题标题】:TypeError: undefined is not a function (evaluating 'addListener')TypeError: undefined is not a function (评估'addListener')
【发布时间】:2018-05-09 20:26:41
【问题描述】:

感觉有很多类似的问题就像这个一样,但似乎没有一个适合我的解决方案。这绝对不是代码相关的问题,一切正常,我运行了更新,现在我无法通过这个错误,有些包显然不能一起工作。

这是我的堆栈跟踪:

TypeError: undefined is not a function (evaluating 'addListener')

This error is located at:
    in CardStack (at CardStackTransitioner.js:67)
    in RCTView (at View.js:71)
    in View (at Transitioner.js:142)
    in Transitioner (at CardStackTransitioner.js:19)
    in CardStackTransitioner (at StackNavigator.js:41)
    in Unknown (at createNavigator.js:13)
    in Navigator (at createNavigationContainer.js:226)
    in NavigationContainer (at Router.js:70)
    in App (at Router.js:91)
    in Router (at Router.js:10)
    in RouterComponent (at App.js:41)
    in Provider (at App.js:40)
    in App (at registerRootComponent.js:35)
    in RootErrorBoundary (at registerRootComponent.js:34)
    in ExpoRootComponent (at renderApplication.js:35)
    in RCTView (at View.js:71)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:71)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:34)
- node_modules\react-native-router-flux\node_modules\react-navigation\src\getChildEventSubscriber.js:72:60 in <unknown>
- node_modules\react-native-router-flux\node_modules\react-navigation\src\getChildEventSubscriber.js:72:45 in getChildEventSubscri
ber
- ... 28 more stack frames from framework internals

这是我当前的依赖项:

"dependencies": {
    "expo": "^25.0.1",
    "firebase": "^4.13.1",
    "lodash": "^4.17.10",
    "react": "16.2.0",
    "react-native": "^0.52.3",
    "react-native-router-flux": "^4.0.0-beta.30",
    "react-native-scripts": "^1.14.0",
    "react-navigation-redux-helpers": "^1.0.6",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0"
  },
  "devDependencies": {
    "babel-jest": "22.4.0",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.4.0",
    "jest-expo": "^25.1.0",
    "react-test-renderer": "16.2.0"
  },

希望有人和我一样遇到过这个问题!

非常感谢,

亚当

【问题讨论】:

标签: javascript reactjs react-native


【解决方案1】:

找到对我有用的方法:

rm -rf node_modules
yarn cache clean
yarn install

如 cmets 所示:https://github.com/aksonov/react-native-router-flux/issues/2799

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-14
    • 2015-06-24
    • 2021-06-21
    • 1970-01-01
    • 2014-08-15
    • 2015-01-14
    • 2014-07-06
    • 2014-09-01
    相关资源
    最近更新 更多