solana-labs / solana-program-library

A collection of Solana programs maintained by Solana Labs
https://solanalabs.com
Apache License 2.0
3.46k stars 2.03k forks source link

`getOrCreateAssociatedTokenAccount` function returning error `TokenAccountNotFoundError` #6603

Closed ShivangRawat30 closed 5 months ago

ShivangRawat30 commented 5 months ago

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.

Screenshot 2024-04-21 at 1 26 13 PM Screenshot 2024-04-22 at 2 42 09 AM
github-actions[bot] commented 5 months ago

Hi @ShivangRawat30,

Thanks for your question!

We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of Solana itself.

Questions like yours deserve a purpose-built Q&A forum. Unless there exists evidence that this is a bug with Solana itself, please post your question to the Solana Stack Exchange using this link: https://solana.stackexchange.com/questions/ask


This automated message is a result of having added the ‘question’ tag.