I want to transfer the spl token but cannot get getOrCreateAssociatedTokenAccount method even in the latest version of @solana/spl-token.
-
Could you provide a picture of your code / error?– OrionCommented Dec 24, 2022 at 12:23
-
showing us the code would be the first step to solving this issue.– vicyynCommented Dec 24, 2022 at 13:08
-
I am getting this error Module '"@solana/spl-token"' has no exported member 'getOrCreateAssociatedTokenAccount'.– AslamCommented Dec 24, 2022 at 15:42
-
I which version of "@solana/spl-token"' the 'getOrCreateAssociatedTokenAccount' is available ?– AslamCommented Dec 24, 2022 at 15:43
Add a comment
|
1 Answer
Try installing @solana/spl-token with an alias name, there might be another dependency that's causing a naming conflict.
npm i name-it-what-you-want-here@npm:@solana/spl-token
It will look like this in package.json
"dependencies": {
"name-it-what-you-want-here": "npm:@solana/spl-token@^0.3.6"
}
Then import with alias name to use
import { getOrCreateAssociatedTokenAccount } from "name-it-what-you-want-here"