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

Cannot convert a BigInt value to a number #87

Open
Zss96 opened this issue May 26, 2022 · 12 comments
Open

Cannot convert a BigInt value to a number #87

Zss96 opened this issue May 26, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@Zss96
Copy link

Zss96 commented May 26, 2022

Our react native app is using secretjs,but
import { SecretNetworkClient } from "secretjs"has a error ,"Cannot convert a BigInt value to a number"
We have version ^1.3.0-beta.1 installed,Node version is v16.15.0, react-native is 0.68

@assafmo
Copy link
Member

assafmo commented May 29, 2022

Hi, how are you compiling/bundling your app?

@Zss96
Copy link
Author

Zss96 commented May 31, 2022

嗨,您如何编译/捆绑您的应用程序?

This is caused by the conversion from ES6 to Es5, because * * becomes math.pow(), but math.pow() does not support bigint type

assafmo added a commit that referenced this issue Jun 6, 2022
To try to solve the ** -> Math.pow() conversion error

#87
#82
@assafmo
Copy link
Member

assafmo commented Jun 6, 2022

Can you please try [email protected]?

@assafmo assafmo added the bug Something isn't working label Sep 28, 2022
@calvinkei
Copy link

encounter the same issue with [email protected]
here is a repo for reproduction https://github.com/calvinkei/expo-secretjs

@itsHaseebSaeed
Copy link

itsHaseebSaeed commented Oct 20, 2022

@assafmo I'm also facing the same issue right now with Reactjs. Currently using [email protected]

@itsHaseebSaeed
Copy link

Update:
Solved by adding this section in package.json:

"browserslist": {
    "production": [
      "chrome >= 67",
      "edge >= 79",
      "firefox >= 68",
      "opera >= 54",
      "safari >= 14"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }

@amityadav0
Copy link

I'm facing the same issue with Reactjs. Adding browserslist didn't work.
Is there any other solution ?

@itsHaseebSaeed
Copy link

itsHaseebSaeed commented Nov 1, 2022

I'm facing the same issue with Reactjs. Adding browserslist didn't work. Is there any other solution?

Try Updating to [email protected] or the latest one.

@amityadav0
Copy link

Not working, can you please point me to any working example with react ?
https://github.com/scrtlabs/SecretJS-Templates/tree/master/6_wallets/reactjs_keplr this doesn't work

@itsHaseebSaeed
Copy link

itsHaseebSaeed commented Nov 1, 2022

Not working, can you please point me to any working example with react ? https://github.com/scrtlabs/SecretJS-Templates/tree/master/6_wallets/reactjs_keplr this doesn't work

It's giving an error because the template's version is secret@^1.3.0-beta.7 More here.

Here's the complete documentation of secretjs. It's updated and works well.

And here's a working example. I'm using secretjs and reactjs.

@amityadav0
Copy link

I used the above example with latest secretjs, It seems this doesn't work with typescript. I used same config as here.
Only difference is typescript and javascript. Will check more.
Thanks for the help.

@assafmo
Copy link
Member

assafmo commented Dec 18, 2022

v1.5 now supports react-native, please check this out https://github.com/scrtlabs/react-native-secretjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants