Im trying to import Moralis from ‘moralis/react-native’ to my code but got an error:
TypeError: Cannot read property 'addListener' of undefined
reactConsoleErrorHandler @ ExceptionsManager.js:184
registerError @ LogBox.js:204
console.error @ LogBox.js:67
reportException @ ExceptionsManager.js:104
handleException @ ExceptionsManager.js:176
handleError @ setUpErrorHandling.js:24
reportFatalError @ error-guard.js:49
guardedLoadModule @ require.js:203
metroRequire @ require.js:127
(anonymous) @ asyncRequire.js:14
executeApplicationScript @ RNDebuggerWorker.js:2
(anonymous) @ RNDebuggerWorker.js:2
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
my package.json
"dependencies": {
"@react-native-async-storage/async-storage": "^1.15.15",
"@walletconnect/react-native-dapp": "^1.7.1",
"crypto-browserify": "^3.12.0",
"moralis": "1.3.2",
"node-libs-react-native": "^1.2.1",
"react": "17.0.2",
"react-dom": "^17.0.2",
"react-moralis": "1.3.1",
"react-native": "0.66.4",
"react-native-dotenv": "^3.3.1",
"react-native-get-random-values": "^1.7.2",
"react-native-svg": "9.6.4",
"web3": "^1.7.0"
},
If I switch to ‘moralis’ (moralis/browser) I able to load the app. Of course in this case I have another issues related to difference between platforms.
What could be the solution to this problem?