o1js icon indicating copy to clipboard operation
o1js copied to clipboard

fetchAccount() throws "TypeError: Cannot destructure property 'publicKey' of 'account' as it is null." error on accounts not included into ledger

Open dfstio opened this issue 10 months ago • 1 comments

Calling fetchAccount() for the account not included in the ledger with o1js 0.18.0 and one of the following devnet endpoints:

https://proxy.devnet.minaexplorer.com/graphql
https://api.minascan.io/node/devnet/v1/graphql

throws the following error:

TypeError: Cannot destructure property 'publicKey' of 'account' as it is null.

      at parseFetchedAccount (node_modules/o1js/dist/node/index.cjs:19925:11)
      at fetchAccountInternal (node_modules/o1js/dist/node/index.cjs:20270:17)
      at fetchAccount (node_modules/o1js/dist/node/index.cjs:20251:10)

dfstio avatar Apr 12 '24 10:04 dfstio

To whoever from us is fixing this: It means that the node returns something which we don't recognize as an error / missing account, and try to parse as an account.

Seems the graphql endpoint behaviour has changed

mitschabaude avatar Apr 12 '24 11:04 mitschabaude