react-native-chat-ui: I am getting this below error

everytime i try to tun the example it says:

Error: While trying to resolve module @flyerhq/react-native-chat-ui from file C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\src\App.tsx, the package C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\lib\index.js. Indeed, none of these files exist:

  • C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\lib\index.js(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  • C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\lib\index.js\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) at DependencyGraph.resolveDependency (C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\node_modules\metro\src\node-haste\DependencyGraph.js:311:17) at Object.resolve (C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\node_modules\metro\src\lib\transformHelpers.js:129:24) at resolve (C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:396:33) at C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:412:26 at Array.reduce (<anonymous>) at resolveDependencies (C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:411:33) at processModule (C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:140:31) at async addDependency (C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:230:18) at async Promise.all (index 2) at async processModule (C:\Users\sriva\Downloads\react-native-chat-ui-main (1)\react-native-chat-ui-main\example\node_modules\metro\src\DeltaBundler\traverseDependencies.js:198:5)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Just did clone and install on a new Mac (not used to develop the library), everything runs (I have latest node, yarn, android studio). Once again:

  1. yarn to install dependencies in the root folder
  2. yarn to install dependencies in the example folder
  3. yarn android to run the app from the example folder

If for some reason example does not compile on Windows, better to help me understand what are the commands you’re doing, rather than throwing random accusations. I don’t have access to Windows, so I am sorry I can’t test there.

Alternatively, rather than using example from the project, you can just add the library through npm and just use it in your project directly, which I believe is configured to work on Windows.

Have a nice day.

I was getting this same error, following the steps suggested revealed that I needed to update my node version. Updating node, and following the procedure again fixed the problem.

I don’t know this is the error which I am getting in 3 different machine:

Error: While trying to resolve module @flyerhq/react-native-chat-ui from file C:\Users\sriva\Downloads\react-native-chat-ui-main\example\src\App.tsx, the package C:\Users\sriva\Downloads\react-native-chat-ui-main\package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (C:\Users\sriva\Downloads\react-native-chat-ui-main\lib\index.js. Indeed, none of these files exist:

Nevermind I am closing the issue, I will rather make my own UI instead, you need to work on the package and test it properly.