Error connecting web3js to react native application - react-native

I ran into a problem connecting web3 to a React Native app.
Initially, the connection was made according to this guide.
Everything worked, but as soon as I restart the application, an error appears:
ReferenceError: Property 'Buffer' doesn't exist, js engine: hermes
ERROR 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., js engine:
hermes
Then I comment on these lines in Live reloading mode
const Web3 = require('web3')
const web3Rospen = new Web3('https://ropsten.infura.io/v3/myKey')
I save the code, the application works, again, in Live reloading mode, I uncomment these lines back - the application works.
But initially, just taking and running the application from web3 does not work. Maybe someone faced such a problem?
Versions:
"react-native": "0.66.4",
"web3": "^1.7.3"

Related

Problems when running a expo app on ventura

I get an expo application from a client. Did all the needed instalations (npm install, pod install, etc...) and when I try to run a npm expo start within the iOS simulator, the bundle is ok, but Im getting this weird error:
iOS Bundling complete 59850ms
ERROR Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.
ERROR 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.
ERROR 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.
I have tried all the reset caches, watchman, etc... But still getting. This is driving me crazy. Any lights here?
Running mac os ventura on a MacbookPro intel.

ReferenceError: Can't find variable: Buffer & Module AppRegistry is not registered callable module (calling runApplication)

I am a newbie on React-native and I am facing some issues. My metro bundler successfully bundles the react native app. after that these errors occur:
ReferenceError: Can't find variable: Buffer
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.
and getting a blank white screen on my emulator as shown: Emulator White Screen
here is a picture from Package.json devDependencies: package.json devDependencies
here are the dependencies from package.json:
any solution will be appreciated.
thanks in advance
I have tried almost all solutions from different resources but unable to fix them.
Please try to update the pusher-js version with 7.4.0. It's working fine for me.
"pusher-js": "^7.4.0",

error hermes startHeadlessTask react native 0.63 when listen react native firebase messaging in quite state

I want to ask, i got an error when i receive push notification data only when apps state is quite / kill apps.
[Mon Nov 23 2020 18:09:48.345] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling startHeadlessTask), js engine: hermes
this error appear when i run in android
The solution for me was to implement setBackgroundMessageHandler at the level where you're registering the app. I passed an empty Promise.resolve since I'm not performing any tasks in the background. It appears that when a notification is triggered whilst the app is not running (completely quit) it attempts to run a headless task so if a handler is not set it throws.
messaging().setBackgroundMessageHandler(() => Promise.resolve());

React Native Invariant Violation error, but nothing seems to be broken

I'm trying to develop an application with React Native, every now and then, I get this error:
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
with no further explanation.
Today the application worked fine, I accidentally had a letter written outside of a functional component, I had an error of course, deleted the extra letter and then I got this error.
Nothing seems to fix this error this time.
I tried closing the server, clearing cache, running the application again, deleted node_modules and did npm install again, nothing works. I have no idea what could go wrong, the application worked fine, and after that letter the application just won't run.
Any ideas? What causes this error?

Unable to debug react native with iOS simulator using VSCode, bundling with babel async error

I'm getting the below error when connecting to the packager from the expo app:
bundling failed: node_modules/expo/AppEntry.js: /Volumes/Tub/Work/TOYL/REACT_NATIVE/rn-complete-guide/babel.config.js: Error while loading config - You appear to be using a native ECMAScript module configuration file, which is only supported when running Babel asynchronously.
I'm new to react development, and want to use VSCode directly for debugging, not Chrome.