Member-only story
Solana Anchor: src.toTwos or src.toArrayLike is not a function
Apr 24, 2022
This is a quick debugging post for development with https://github.com/project-serum/anchor
If you’re getting the error message
TypeError: src.toTwos is not a function
or
TypeError: src.toArrayLike is not a function
then you might have forgotten to turn your number into a Big Number
use
new anchor.BN()
to parse your existing number into a Big Number, and the error should go away.