reown-com / appkit

The full stack toolkit to build onchain app UX
https://reown.com/appkit
Apache License 2.0
4.91k stars 1.4k forks source link

[bug] Error: failed to get balance of account #3050

Open bonnusi opened 1 week ago

bonnusi commented 1 week ago

Link to minimal reproducible example

https://appkit-lab.reown.com/library/solana/

Summary

The error drops with some unclear frequency Uncaught (in promise) Error: failed to get balance of account [account]: n: Expected the value to satisfy a union of 'type | type', but received: [object Object]

This problem not only for Phantom wallet, also for trust wallet and solflare wallet

Network - solana mainnet

https://github.com/user-attachments/assets/d341b12c-cb2c-40c2-8123-f1045d0fbdd2

image image image

List of related npm package versions

"@reown/appkit": "1.0.7", "@reown/appkit-adapter-solana": "1.0.7", "@tanstack/react-query": "5.24.8", "react": "18.2.0", "react-dom": "18.2.0", "vite": "5.2.11", "@solana/wallet-adapter-backpack": "0.1.14", "@solana/wallet-adapter-wallets": "0.19.32"

DaveTheFrontEndDev commented 1 week ago

Also encountered this issue, and experienced this intermittently. I have a code example with it set up here https://github.com/DaveTheFrontEndDev/reown-solana-transaction-bug