0

enter image description here

I'm facing this error when I'm interacting with an onchain program on solana using anchor in expo react native , its the same outcome when I run it with the AnchorCounterProgram example on the tutorials repo This is the error I get when I try fetching an account const fetchAndUpdateCounter = useCallback( async (program: Program) => { try { const counterAccount = await program.account.counter.fetch(counterPDA); console.log('counter account', counterAccount.count.toString()); } catch (error) { console.error(error); } }, [counterPDA] ); [TypeError: b.readUIntLE is not a function (it is undefined)]

1 Answer 1

2

Spoke offline and found a temporary fix for this issue.

Workaround is to downgrade your Anchor version (both Anchor CLI and @coral-xyz/anchor in your RN project) to <= v0.28.0.

The root cause of this issue is some polyfill issue with the buffer package in React Native. Will report back when I discover the root cause.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.