react-native: TypeError: Super expression must either be null or a function
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
TypeError: Super expression must either be null or a function
_inherits
inherits.js:5:10
<unknown>
index.bundle?platform=ios&dev=true&minify=false:157734:27
<unknown>
index.bundle?platform=ios&dev=true&minify=false:157939:3
loadModuleImplementation
require.js:321:4
guardedLoadModule
require.js:210:11
metroRequire
require.js:128:6
<global>
index.js:7
loadModuleImplementation
require.js:321:4
guardedLoadModule
require.js:210:11
metroRequire
require.js:128:6
React Native version:
System:
OS: macOS 10.15.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 1.49 GB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.19.0 - ~/.nvm/versions/node/v10.19.0/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v10.19.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
React-native :
0.61.5 => 0.62
## Steps To Reproduce
Upgrade error
## Expected Results
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 22
I used RN 0.62.2 and it works fine in IOS , but when i trying to run it with android i get the error you mention above… i checked all your’s suggestions but it’s didn’t help. Any advise guys? Answer- Problem with RN 0.62 + ‘react-native-gifted-chat’ after comment ‘react-native-gifted-chat’ the problem was solved https://github.com/FaridSafi/react-native-gifted-chat/issues/1703
All the workarounds I’m seeing are to change the class you are extending, or upgrade a library.
Can someone explain the underlying issue that causes this error?
ni samjh ara
I fixed my problem on React-Native 0.62.2, replacing:
export class MyComponent extends TouchableHighlight {
withexport class MyComponent extends React.Component {
In my case the problem was indeed react-native-gifted-chat, however I am adding myself to the list of the curious people who would like to know the cause of the problem and mostly why it happens only on android.
I am running into this issue as well and, like @curiousdustin , am really curious of the underlying cause. I’m not sure where to start looking for what is broken. The stack trace is minified code on top of minified code.
I had this issue after upgrading from 0.61.5 to 0.62, and it was caused by @expo/react-native-action-sheet.
https://github.com/expo/react-native-action-sheet/issues/161
The extends problem requires modifying all extends