I created a new token with metadata with this guide. Now I want to create the corresponding token account by using
const tokenAccount = await getOrCreateAssociatedTokenAccount(
connection,
payer,
mint,
payer.publicKey,
);
However, I get a TokenAccountNotFoundError. I tried chatgpt, I tried using other methods to create a token account but I always got a different error. (Also tried saving the token address and then trying to create the token account a few minutes later)
TokenAccountNotFoundError at unpackAccount (C:\Users\PycharmProjects\metadata\node_modules@solana\spl-token\src\state\account.ts:170:22) at C:\Users\PycharmProjects\metadata\node_modules@solana\spl-token\src\state\account.ts:103:12 at Generator.next () at fulfilled (C:\Users\PycharmProjects\metadata\node_modules@solana\spl-token\lib\cjs\state\account.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:95:5)