Skip to content
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

Starting from 1.53.0 web3.js breaks compatibility with React Native #27685

Closed
lexer opened this issue Sep 8, 2022 · 6 comments
Closed

Starting from 1.53.0 web3.js breaks compatibility with React Native #27685

lexer opened this issue Sep 8, 2022 · 6 comments
Labels
community Community contribution

Comments

@lexer
Copy link

lexer commented Sep 8, 2022

Problem

Starting from 1.53.0 web3.js breaks compatibility with React Native

I suspect some changes that uses BigInt might have caused this. BigInt is not supported in React Native.

Error log:

SyntaxError: 256428:32:BigInt literal is not supported, js engine: hermes

Proposed Solution

@lexer lexer added the community Community contribution label Sep 8, 2022
@paulmillr
Copy link

BigInt is not supported in React Native

it is supported in react native 0.70, you need to upgrade

@steveluscher
Copy link
Contributor

You're absolutely correct! You can read all about the new requirements going forward, here:

@steveluscher
Copy link
Contributor

Added some notes to the web3.js README about this.

@lexer
Copy link
Author

lexer commented Sep 10, 2022

@steveluscher After upgrading to React Native 0.70 I'm getting a new error

TypeError: Cannot convert BigInt to number, js engine: hermes

@lexer
Copy link
Author

lexer commented Sep 10, 2022

I think I made it work.

Needed this change in babel.config.js:

module.exports = {
  presets: [
    [
      'module:metro-react-native-babel-preset',
      {unstable_transformProfile: 'hermes-stable'},
    ],
  ],
};

@steveluscher
Copy link
Contributor

Yep! It’s all in the Cookbook. Make sure to read the whole thing, there might be more things to configure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

No branches or pull requests

3 participants