Lesson # 14: Error occur while deploying mint.js to the sepolia network. #5564
-
Basic NFT works fine but when it comes to dynamic svg nft it gives this error shown below. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@abdullahtanvir11 The issue is clearly mentioned in your error if you try to read it you can easily understand the problem. It says Because you are looking to token id console.log(`Dynamic SVG NFT index 0 tokenURI: ${await dynamicSvgNft.tokenURI(0)}`) but you minted the token for token id function mintNft(int256 highValue) public {
s_tokenIdToHighValues[s_tokenCounter] = highValue;
s_tokenCounter += 1;
_safeMint(msg.sender, s_tokenCounter);
emit CreatedNFT(s_tokenCounter, highValue);
} Here you first increment the token counter and then you mint the token with an incremented token counter which is If you want to start from token Id |
Beta Was this translation helpful? Give feedback.
@abdullahtanvir11 The issue is clearly mentioned in your error if you try to read it you can easily understand the problem. It says
execution reverted: URI Query for the nonexistent token
which means the token you are looking for does not exist.Because you are looking to token id
0
here;but you minted the token for token id
1
Here you first increment the token counter and then you mint the t…