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

Expo Android send message "undefined is not a function"

Open JP-902130 opened this issue 1 year ago • 3 comments

Issue Description

In Android, upon sending a message, it immediately raises an error "TypeError: undefined is not a function, js engine: hermes"

Steps to Reproduce / Code Snippets

Send a message on android

Expected Results

Send a message successfully

Additional Information

  • Nodejs version: [FILL THIS OUT]
  • React version: [FILL THIS OUT]
  • React Native version: [FILL THIS OUT]
  • react-native-gifted-chat version: [FILL THIS OUT]
  • Platform(s) (iOS, Android, or both?): [FILL THIS OUT]
  • TypeScript version: [FILL THIS OUT]

JP-902130 avatar Aug 13 '23 20:08 JP-902130

I think there is something to do with getRandomBase64String()

JP-902130 avatar Aug 21 '23 16:08 JP-902130

@Justin-Jingcheng-Peng I put some of the suggestions, you can check might be your issue has been solved, Hopefully!!

  1. Clearing the Cache: Clear the cache of your React Native project by running the following command in your project's root directory:
npx react-native start --reset-cache

After This Try to Re-Create the Build for the App 2. Check the Hermes: Ensure that the libraries you are using are compatible with the Hermes engine. Some libraries might not work well with Hermes due to its stricter JavaScript engine. If possible install degrade the version, clear the cache, and try again 3. Try to go TypeScript File where you are facing the issue(Mean which Typescript file if you able to figured it): so if possible just add the optional chaining for there.

I am confident your problem might be solved, if not please let me know and add more details of the error. will look on it

having the same issue but only in deployed version.

I solved the problem by importing relativeTime Plugin from dayjs. I used dayjs for timestamps with relative time and forgot to import it in the component.

borstessi avatar May 06 '24 12:05 borstessi