TypeError: Moralis.Web3API.token.reSyncMetaData is not a function

Hello!

Whenever I try to run this block of code I get an error

const Moralis = require('moralis/node');
const collectionAddress = "0x526d60592806E63D1088bd6ca74956A63d965254";
const serverUrl = "https://i87mjzyl0a8e.usemoralis.com:2053/server";
const appId = "";
Moralis.start({serverUrl, appId});

async function sync() {

    const NFTs = await Moralis.Web3API.token.getAllTokenIds({address: collectionAddress, chain: "polygon" })
    const TotalNum = NFTs.total;
    //console.log(TotalNum.length);
    const timer = ms => new Promise(res => setTimeout(res, ms))

    for(let i = 0; i < NFTs.total; i++){
        console.log(i);
        const options = {address: collectionAddress, token_id: i, chain: "polygon", flag: "metadata"};
        await Moralis.Web3API.token.reSyncMetaData(options);
    
        await timer(30000);
    }
};

sync();

TypeError: Moralis.Web3API.token.reSyncMetaData is not a function

Any ideas what I am unable to call the reSyncMetaData function? I followed the steps here:

https://docs.moralis.io/moralis-server/web3-sdk/token#resyncmetadata

This is a typo.

It should be - Moralis.Web3API.token.reSyncMetadata

Oh wow thanks that totally fixed it :slight_smile:

2 Likes