-
Notifications
You must be signed in to change notification settings - Fork 40
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
Wallet and SecretNetworkClient from "secretjs" are undefined #82
Comments
Hi, can you share a repo for me to play with or a code example? |
Unfortunately I cannot because it's a proprietary repo, but there is a new error, all I am doing is following the simple code example here: https://github.com/scrtlabs/secret.js#sending-queries This code: // To create a readonly secret.js client, just pass in a gRPC-web endpoint const { console.log( Is throwing this error: |
Can you try converting |
I tried that but it doesn't help because the issue is importing, the error thrown is: Error: Requiring module "node_modules/secretjs/dist/browser.js", which threw an exception: TypeError: Cannot convert a BigInt value to a number Which I believe is an error in a file on your end where there is an attempt to convert a BitInt to a Number |
How are you running/compiling this? Using webpack/esbuild/vite? What version of node.js? |
Can I get access to the code if I sign an NDA? This seems like an issue with secret.js and I want to iterate faster to solve it. |
It's a react-native app, so we're doing rn-nodeify in order to get some other dependencies to work, and it's interesting that secretjs 0.17.5 works, just not the latest version, but we want the latest version.
I will ask the team lead, or maybe we can coordinate a screenshare session or something |
Can you help me set up an empty project? Just to try and reproduce this on my machine. |
Hi Assaf, thanks for your attentiveness to my issue, I really appreciate it. I've set up a barebones react-native project, and all I did was install the latest version of secretjs and try to do the example in the docs, the code for this can be found here: https://github.com/noahNewton/rn-secretjs-test I am still faced with the same error: "TypeError: Conversion from 'BigInt' to 'number' is not allowed." |
My machine is running node version v16.13.2 and the project is react-native-cli v2.0.1 and react-native 0.67.3 This is very strange, is it possible the Xcode/iOS simulator could be causing this issue? Because it looks like the above is not using react-native? |
What is your environment like? Node version? Can you try running it in the xcode ios simulator? |
I'll try, I don't have xcode but I think I have a lead |
Any update @assafmo? Or need any more info? |
Hi, can you try to use |
Hi, can you please try |
v1.5 now supports react-native, please check this out https://github.com/scrtlabs/react-native-secretjs |
Our react native app is trying to import the Wallet class and SecretNetworkClient class and use them to make a transaction as per this documentation: https://secretjs.scrt.network/#broadcasting-transactions
The error I am getting is "TypeError: Cannot read properties of undefined (reading 'Wallet')" when I try to instantiate the object using our mnemonic or when using your mnemonic in the aforementioned documentation.
It is very strange because when I hover over "Wallet" in VScode it will display the comment and @params that are present in your secretjs/dist/wallet_*.js/ts files as if it is indeed imported and is defined.. so perhaps there is an issue in your inheritance model on your end?
We have version ^1.2.0-beta.58 installed
Let me know if you need any more information, thanks in advance for taking a look into this!
The text was updated successfully, but these errors were encountered: