"URI query for non existant token" when minting randomIpfsNft #3063
-
Hi, in the NFT lesson when deploying script 04-mint.js I get the aforementioned error , with following description: Error: call revert exception; VM Exception while processing transaction: reverted with reason string "URI Query for nonexistant token" [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="tokenURI(uint256)", data="0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001f55524920517565727920666f72206e6f6e6578697374616e7420746f6b656e00", errorArgs=["URI Query for nonexistant token"], errorName="Error", errorSignature="Error(string)", reason="URI Query for nonexistant token", code=CALL_EXCEPTION, version=abi/5.7.0) Any help, thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@bonannogiovanni Make sure in the dynamic nft contract's mintNft function you have increased the counter after minting the nft. |
Beta Was this translation helpful? Give feedback.
-
You're right!! Actually I was incrementing the counter before minting so tokenid would start at 1 instead of 0 and the query would not find index 0 (I'm almost sure that's an error Patric made in the video and I followed suit :)) Thanks again! |
Beta Was this translation helpful? Give feedback.
@bonannogiovanni Make sure in the dynamic nft contract's mintNft function you have increased the counter after minting the nft.