react-native-gifted-chat icon indicating copy to clipboard operation
react-native-gifted-chat copied to clipboard

Native module not found

Open HenrikZabel opened this issue 1 year ago • 11 comments

Issue Description

Whenever I click on "Send" following error occurrs

ERROR Error: Native module not found, js engine: hermes

There are no more details logged.

Steps to Reproduce / Code Snippets

https://github.com/FaridSafi/react-native-gifted-chat?tab=readme-ov-file#example

I've used the official example

Expected Results

The message should be appended

Additional Information

  • Nodejs version: v21.5.0
  • React version: 18.2.0
  • React Native version: 0.74.3
  • react-native-gifted-chat version: ^2.6.0
  • Platform(s) (iOS, Android, or both?): Android (Couldn't test iOS)
  • TypeScript version: ~5.3.3

HenrikZabel avatar Aug 27 '24 22:08 HenrikZabel

I also get the same error, error received on both Android and iOS

Nicholas1K avatar Aug 28 '24 08:08 Nicholas1K

For me it's even before the send, it's when i run npx expo run:ios/android. And also in 2.6.0 the property renderUsernameOnMessage: PropTypes.Requireable<boolean>; was removed so messages doesn't have username rendering.

HaythamT95 avatar Aug 28 '24 09:08 HaythamT95

Issue Description

Whenever I click on "Send" following error occurrs

ERROR Error: Native module not found, js engine: hermes

There are no more details logged.

Steps to Reproduce / Code Snippets

https://github.com/FaridSafi/react-native-gifted-chat?tab=readme-ov-file#example

I've used the official example

Expected Results

The message should be appended

Additional Information

  • Nodejs version: v21.5.0
  • React version: 18.2.0
  • React Native version: 0.74.3
  • react-native-gifted-chat version: ^2.6.0
  • Platform(s) (iOS, Android, or both?): Android (Couldn't test iOS)
  • TypeScript version: ~5.3.3

Hi Can you share full error? Also please try to run code from ./example

kesha-antonov avatar Aug 28 '24 09:08 kesha-antonov

And also in 2.6.0 the property renderUsernameOnMessage: PropTypes.Requireable<boolean>; was removed so messages doesn't have username rendering.

What do you mean?

https://github.com/search?q=repo%3AFaridSafi%2Freact-native-gifted-chat%20renderUsernameOnMessage&type=code

kesha-antonov avatar Aug 28 '24 09:08 kesha-antonov

[UPDATE]

Npm install works but running the example is not working:

npx expo start

C:\Projects\Henrik\test\example\node_modules\fb-watchman\index.js:99
          var error = new Error(obj.error);
                      ^
Error: class std::system_error: CreateFileW for openFileHandle: C:\Projects\Henrik\test\src: The system cannot find the file specified.
    at BunserBuf.<anonymous> (C:\Users\Henrik\Desktop\test\example\node_modules\fb-watchman\index.js:99:23)
    at BunserBuf.emit (node:events:519:28)
    at BunserBuf.process (C:\Projects\Henrik\test\example\node_modules\bser\index.js:292:10)
    at C:\Projects\Henrik\test\example\node_modules\bser\index.js:247:12
    at processTicksAndRejections (node:internal/process/task_queues:77:11)

HenrikZabel avatar Aug 28 '24 09:08 HenrikZabel

@kesha-antonov I don't really get an error except ERROR Error: Native module not found, js engine: hermes. The example will not even install

HenrikZabel avatar Aug 28 '24 10:08 HenrikZabel

And also in 2.6.0 the property renderUsernameOnMessage: PropTypes.Requireable<boolean>; was removed so messages doesn't have username rendering.

What do you mean?

https://github.com/search?q=repo%3AFaridSafi%2Freact-native-gifted-chat%20renderUsernameOnMessage&type=code

Note: when the project is JS there is no problem with this error, but when it's typescript there is an error.

Screenshot 2024-08-28 at 13 05 18

When I go to giftedchat component the property is not present their. Screenshot 2024-08-28 at 13 03 17

It's present in Bubble component though, but even if I put the property into the Bubble component the username still does not appear.

Screenshot 2024-08-28 at 13 12 46 Screenshot 2024-08-28 at 13 14 35 Screenshot 2024-08-28 at 13 16 54

HaythamT95 avatar Aug 28 '24 10:08 HaythamT95

I am getting the same issue. whenever I press the send button it throws an error, Native module not found, js engine: hermes

sukarn-dsb avatar Aug 28 '24 10:08 sukarn-dsb

Did you also install reanimated?

https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/

kesha-antonov avatar Aug 28 '24 11:08 kesha-antonov

Yes. Everything is installed as documented. Is the example working on your machine?

HenrikZabel avatar Aug 28 '24 11:08 HenrikZabel

Looks like issue with this lib

https://github.com/uuidjs/uuid/issues/570

I'll make a fix

kesha-antonov avatar Aug 28 '24 14:08 kesha-antonov

I resolved this error by adding a dep in my package.json to react-native-get-random-values, then npx pod-install for iOS. You'll need to rebuild for android.

jamesholcomb avatar Aug 28 '24 15:08 jamesholcomb

gifted I have the above issue but fixed with @jamesholcomb suggestion

mirsahib avatar Aug 29 '24 05:08 mirsahib

Released fix in 2.6.1 https://www.npmjs.com/package/react-native-gifted-chat/v/2.6.1

Follow installation guide once again https://github.com/FaridSafi/react-native-gifted-chat?tab=readme-ov-file#installation

kesha-antonov avatar Aug 29 '24 13:08 kesha-antonov

Compared to the previous version that did not open, now with 2.6.1 the "Native module not found" error is triggered at onSend.

MGS-DEV avatar Aug 29 '24 16:08 MGS-DEV

Please try https://github.com/FaridSafi/react-native-gifted-chat/releases/tag/2.6.2

Follow installation guide once again https://github.com/FaridSafi/react-native-gifted-chat?tab=readme-ov-file#installation

kesha-antonov avatar Aug 30 '24 13:08 kesha-antonov

It works now, thank you very much!

MGS-DEV avatar Aug 30 '24 16:08 MGS-DEV

Got this issue in 2.6.3 but also resolved the same way @jamesholcomb did it in

https://github.com/FaridSafi/react-native-gifted-chat/issues/2519#issuecomment-2315623637

121-vip avatar Sep 24 '24 05:09 121-vip