Error connecting web3js to react native application

Viewed 66

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"
0 Answers
Related