Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type Errror: Super expression must either be null or a function (GiftedChat)

I am using GiftedChat npm for chatting mechanism in react native. It was working fine in lower react native version. I have upgraded react native version to 0.62.0

Now I am getting and exception from GiftedChat saying "TypeError: super expression must be null or function" . Error occurring in android device. See attached screenshot for details.

enter image description here

How to solve this?

Any kind of suggestion would be appreciated.

like image 586
Exigente05 Avatar asked Jun 17 '26 20:06

Exigente05


2 Answers

I solved the same issue by executing npm install [email protected] --save and didn't get that problem anymore.

like image 65
Ney Avatar answered Jun 20 '26 10:06

Ney


There is an issue opened on Gifed Chat github repo

which describes the same problem there and provides couple of temporary solutions i myself am using this

But you need to reset your previous installation in your npm modules here's what i did

  1. Find "react-native-gifted-chat" in your package.json
    "dependencies": {
        "@types/lodash.uniqueid": "^4.0.6",
        "lodash.uniqueid": "^4.0.1",
        "react": "16.11.0",
        "react-native": "0.62.1",
        "react-native-gifted-chat":"<your current version>" //delete this line
    },
  1. delete "react-native-gifted-chat"
  2. go to root folder and delete node_modules and package-lock.json
  3. in your package.json paste
        "react-native-gifted-chat": "git+https://github.com/StagasaurusRex/react-native-gifted-chat.git#upgrade-action-sheet"

where your previous "react-native-gifted-chat" entry was

  1. reinstall npm modules by launching npm install in root folder
  2. this worked for me and got rid of this error

Still you should subscribe to Gifted Chat repository to look for updates, since when the official update comes out, you would want to go back to official npm package. Because User who provided temporary fix migh delete their repository. To watch for updates click on eye icon in Gifted Chat repository. Gifted Chat github

Also if you are afraid that user who provided their temporary solution might delete their repo prematurely, you could fork Gifted Chat repo, fix errors and use it instead.

like image 39
Andris Laduzans Avatar answered Jun 20 '26 09:06

Andris Laduzans



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!