-
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
ReferenceError: Can't find variable: BigInt #6495
Comments
@zahir-dct can you create a small repository on GitHub or create a sample on a Cloud IDE like https://codesandbox.io/ with above error. |
|
Hi @zahir-dct, |
I already tried version 4.x, but it doesn't work. |
Hi @zahir-dct By the way, I tried adding However, I will keep this issue open in order to check for possible workarounds till expo supports BigInt. |
I am closing this issue as there is nothing to be done at web3.js. However, for those facing this error, here is a way to work around it (as mentioned in facebook/react-native#28492 (comment)):
if (typeof BigInt === 'undefined') {
global.BigInt = require('big-integer');
}
// make sure you use `import` and not `require`!
import './shim.js' However, if the above did not work, or if you did not like the way it works, I suggest to check with, rn-nodeify, expo and react-native... |
react-native 0.70 (expo sdk 47) does not support BigInt. please try to update to latest sdk for the BigInt support. |
It work with my project. Thank you very much |
Actual behavior
App crashes
Steps to reproduce the behavior
add web3 package to an expo app
Logs
ERROR ReferenceError: Can't find variable: BigInt
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
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.
Environment
"expo": "~47.0.12",
"react": "18.1.0",
"react-native": "0.70.8",
"web3": "^1.8.2",
Note
I removed "^" from "^1.8.2", the app doesn't crash
The text was updated successfully, but these errors were encountered: