I am trying to fetch all accounts owned by my program using all()
method but it is giving me this nasty error:
Uncaught (in promise) ReferenceError: Buffer is not defined
at AccountClient.all
Code:
const accounts = await program.account.user.all();
It works if I try to fetch a single account like this:
const account = await program.account.user.fetch(new PublicKey("..."));
.all()
,await program.account.user.all()
. Unless you're trying to usememcmp
user
account struct in your program been updated before? (ex. added new fields)