I cloned rarible in 24hr - 7 / NFT not getting minted

Get to the last part of the video to test the minting and on clicking create I get the parseobjectsubclass with the item info and the item shows up on the server but I never get metamask being called to sign the transaction and do not get the transaction receipt. I am not seeing any errors other than a warning in the dev tools (below) β€” not sure what is wrong

" A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. In a future version of Chrome, the amount of information available in the User Agent string will be reduced.

To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.

Note that for performance reasons, only the first access to one of the properties is shown."

Hi,

that warning has nothing do to with your issue. Could you share the code that you use to actually call the smart contract to mint?
Something like below. It inits the token contract code to use with web3 (metamask) so you can call the actual method in your contract. That should trigger metamask to make the call:

const tokenContract = new web3.eth.Contract(tokenAbi, tokenContractAddress);

tokenContract.methods.mint(token_uri).send({from: senderAddress})
.on('receipt',  (receipt)  => {
  console.log(receipt)
});

Good luck!

2 Likes

Hello, I was having a similar issue. I keep getting the error:

Uncaught (in promise) ReferenceError: tokenContract is not defined
at mintNFT (main.js:173)
at HTMLButtonElement.createItem (main.js:153)
mintNFT @ main.js:173
createItem @ main.js:153
async function (async)
createItem @ main.js:136

Even though I tried using the code written in this thread, as well as the original tutorial code.

Not sure why it says it isn’t defined even when I have the line:

const tokenContract = new web3.eth.Contract(tokenAbi, tokenContractAddress);

in my mintNFT file.

Are you using this code?

That should work unless it’s not up to date, better to loop in @Yomoo to confirm.
Always best to post your full code causing the error.

1 Like

Yes, please do share your code and better yet do check out this post which lists out all the basic errors you would face while creating this clone –

Make sure to check for code differences from the github repo that @matiyin provided.

Do let us know how it goes.

Thanks.