This repository was archived by the owner on Mar 11, 2025. It is now read-only.
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
getOrCreateAssociatedTokenAccount
function returning error TokenAccountNotFoundError
#6603
Closed
Description
I am trying to make an associated token account for my project.
const mintAddress = new PublicKey(
"Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
);
console.log(connection, wallet, mintAddress, wallet.publicKey);
const toAta = await getOrCreateAssociatedTokenAccount(
connection,
wallet,
mintAddress,
wallet.publicKey,
);
this code is returning a TokenAccountNotFoundError
I am using USD Coin Dev token for this project and the error looks like this.

