React-native-gifted-chat: "methods.ForEach is not a function" in example project

Created on 4 Oct 2016  ·  3Comments  ·  Source: FaridSafi/react-native-gifted-chat

Issue Description

When running the xample project (npm install -> react-native run-ios), the app launches but immediately crashes with the error:

Steps to Reproduce / Code Snippets

Run example app as usual, get this error:
Unhandled JS Exception: TypeError: methods.forEach is not a function. (In 'methods.forEach', 'methods.forEach' is undefined)

Additional Information

  • React Native version: 0.34
  • react-native-gifted-chat version: current master branch example project
  • Platform(s) (iOS, Android, or both?): iOS, haven't tested on android

Also, I am able to build the project successfully in Xcode, but still get this error immediately after the app actually launches. A quick search through both the Xcode project and the JS files reveals no references to "methods.forEach" that I could find. Also, I should add that I was able to add gifted chat to my own project with no issues, so it only happens with the example project. Any idea why this is happening?

Most helpful comment

Google translate of @wangdetong's comment because it helped me.

I have encountered this problem, and later resolved:
You may run a number of projects, run the current project to ensure that the last project npm start is closed

I had another project on a later version of react-native whose packager was still running. Killing that and re-running the project fixed this problem for me.

All 3 comments

我也遇到这个问题了,后来解决了:
你可能run了多个项目,run 当前的项目的时候 确保 上一个项目 的npm start 是关闭的

Google translate of @wangdetong's comment because it helped me.

I have encountered this problem, and later resolved:
You may run a number of projects, run the current project to ensure that the last project npm start is closed

I had another project on a later version of react-native whose packager was still running. Killing that and re-running the project fixed this problem for me.

@wangdetong Comments in English helps more people. Thanks. Your comment helped me, too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yogiben picture yogiben  ·  3Comments

inceptivetech picture inceptivetech  ·  3Comments

radvc picture radvc  ·  3Comments

SytzeAndr picture SytzeAndr  ·  3Comments

cassioseffrin picture cassioseffrin  ·  3Comments