-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web3 v4 not working with ReactNative/Expo #6253
Comments
I was able to create a very rough web app using:
|
@olafkrawczyk what web3.js functions / scenario you are using? can you share your code in some repo with error? |
@olafkrawczyk closing this issue as there is no activity and we are not able to reproduce. Feel free to open issue if error is still there and you have more info. |
I can say i reproduce this here is my package.json dependencies
You should def reopen this ticket... RIght now developing react-native features with web3 is imposible. |
The FK, i have been trying to fix this issue, my code runs well with no error from my local environment, but i kept getting this BigInt errors after deployment, thereby crashing the whole app Uncaught TypeError: Cannot convert a BigInt value to a number |
Thanks It seems while local building this error is not occurring but occurs during deployment in prod ? We will investigate it. |
@jdevcs I also have the same issue. In development, no problems, in production, I get the same error. There seems to be a problem in the converters.ts file from web3 when using it in the the react components. Any workarounds or suggestions? |
Expo 49 I get the following error: ERROR ReferenceError: Property 'EventTarget' doesn't exist, js engine: hermes
ERROR Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes |
ReferenceError: Property 'EventTarget' doesn't exist, js engine: hermes |
For the following error: You will have to downgrade web3 from version 4.2.+ to |
To solve
I use latest web3 4.4.0 with bare expo 49 & RN 0.72.9 |
Did some investigation and this issue is because we use EventTarget in the codebase for browsers and reactnative does not support this natively.. A solution we can use is suggested by marin eventemitter3. will take a look into implementing this and see the bundlesize afterwards |
Hi @luu-alex , |
@Muhammad-Altabba Hi there, |
@olafkrawczyk @horatiubran @the-unknown @Yogeshwar267 |
Expected behavior
Web3 v4 package working with ReactNative. Previous version v1 was working fine.
Actual behavior
When trying to use web3 v4 in Expo app it throws errors like:
TypeError: Cannot convert BigInt to number, js engine: hermes
orReferenceError: Property 'TextEncoder' doesn't exist, js engine: hermes
Steps to reproduce the behavior
Logs
Error is coming from line 18 in web3-utils/lib/commonjs/converters.js
const expo10 = (expo) => base ** BigInt(expo);
Environment
Expo with SDK 48
The text was updated successfully, but these errors were encountered: