NFT > NFT Not Found when calling create #128
-
I'm getting an odd error when calling
I think the issue is that findByMint is not giving the txn enough time to propagate through, but I don't really know. async create(input: CreateNftInput): Promise<{ nft: Nft } & CreateNftOutput> {
const operation = createNftOperation(input);
const createNftOutput = await this.metaplex.operations().execute(operation);
const nft = await this.findByMint(createNftOutput.mint.publicKey);
return { ...createNftOutput, nft };
} |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Calling directly worked, but I will sometimes still get the following error:
Is there a code example of how to catch this (or other MetaplexErrors) to handle them correctly? I'm having trouble catching since they're only happening sporadically on mainnet. |
Beta Was this translation helpful? Give feedback.
-
I'm actually running into this error on Devnet... but the NFT is not even been created... This is how I'm using it:
Anything I can do to help? |
Beta Was this translation helpful? Give feedback.
-
The CreateNft operation has a race condition where it I worked around this issue by adding retries to In the createNft method, I replaced this:
with this:
|
Beta Was this translation helpful? Give feedback.
-
I opened a pull request for this issue: https://github.com/metaplex-foundation/js/pull/406/files Tested by building locally and confirming the "Account Not Found" error doesnt show up anymore |
Beta Was this translation helpful? Give feedback.
-
Loris has a great answer and proposal how you can handle the error here: this works until the SDK has been modified a bit more to split the write and read commands which allow you to handle such things properly. |
Beta Was this translation helpful? Give feedback.
Loris has a great answer and proposal how you can handle the error here:
#406 (comment)
this works until the SDK has been modified a bit more to split the write and read commands which allow you to handle such things properly.