I appreciate the help so far, I am finally able to access my site locally! When I run the site with the console I get the following errors:
Further, when I try to mint using āCreateā button I get this error
This is line 203-212
loadItems = async () => {
const items = await Moralis.Cloud.run("getItems");
user = await Moralis.User.current();
items.forEach(item => {
if (user){
if (user.attributes.accounts.includes(item.ownerOf)){
const userItemListing = document.getElementById(`user-item-${item.tokenObjectId}`);
if (userItemListing) userItemListing.parentNode.removeChild(userItemListing);
getAndRenderItemData(item, renderUserItem);
return;
lines 194-199:
loadUserItems = async () => {
const ownedItems = await Moralis.Cloud.run("getUserItems");
ownedItems.forEach(item => {
const userItemListing = document.getElementById(`user-item-${item.tokenObjectId}`);
if (userItemListing) return;
getAndRenderItemData(item, renderUserItem);
line 161:
const nftId = await mintNft(nftFileMetadataFilePath);
and lines 179-182:
mintNft = async (metadataUrl) => {
const receipt = await tokenContract.methods.createItem(metadataUrl).send({from: ethereum.selectedAddress});
console.log(receipt);
return receipt.events.Transfer.returnValues.tokenId;
The line that gives an error when the page first runs is line 204:
const items = await Moralis.Cloud.run("getItems");
I included the whole function that includes this line for context above.
I am trying to follow along with the tutorial, and it is an advantage to have the code written on Github already. I just need help tweaking it so it functions properly. Thank you