-
Notifications
You must be signed in to change notification settings - Fork 361
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
In the RN, api.query.xxx, api.tx.xxx, undefined is not a object. #526
Comments
Only on Android. I think this is the metadata parsing going wrong, quite possibly related to the polyfill for u8a to string which is used in this environment. |
Can you just double check that the API versions dor the desktop and RN match up as well? (There has been a breaking metadata change at the end of last year, so if the node is recent, just need to make sure the API has support for it) |
@jacogr I tested the RN @polkadot/api version: 0.35.19; // have the same issue. |
Brilliant, thanks. Ok, I will take a look into the decoding then, somewhere the decoding polyfill (TextDecoder) is not playing along would be my guess. |
Does the IOS running the api.query.balances.freebalance() is ok? Not have this issue? |
On iOS only tested subscribe on new head and the extracting the block. I will extend that example with more. (It could still be an issue, untested as you suggested so I just don’t know - however it is much saner with encoders and Uint8Array, so may be fine) |
The above is with the RN sample in https://github.com/jacogr/pjs-rn-rncli updated to also display balances. So it really seems to point to (another) Android-specific issue. Additionally, have checked the TextEncoder/TextDecoder polyfills (by only using them) and it does the correct thing, so it does not point to that area either. So will have to do a bit more digging, somewhere in the Uint8Array handling Android is not too happy. |
For future reference - the current JSC version inside RN Android is from 2014, so areas like Uint8Array is not supported. (For iOS the on-device JSC is used, so any recent 10.x+ is ok) The RN team is looking to upgrade to track actual recent versions, for now installing the above package and removing the (not-quite-working Uint8Array polyfills) does the trick. (I need to update my sample repo to reflect that) Hopefully the issue will be addressed in a new RN update soon. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
It's complete.
It‘s incomplete, so.. such as api.query.xxxx, api.extrinsics, api.tx, and more, can't to be working.
The text was updated successfully, but these errors were encountered: