[SOLVED] Moralis SDK Error

How do I fix MoralisError [Moralis SDK Error]: [C0009] Modules are started already. This method should be called only one time.

try {

await Moralis.start({

    api key:

});



const response = await Moralis.EvmApi.token.getTokenPrice({

  "chain": "0x38",

  "include": "percent_change",

  "address": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"

});



console.log(response.raw);

} catch (e) {

console.error(e);

}

return res.status(200).json({});

({

Hi @idg

You can fix that error by calling Moralis.start after checking if Moralis.Core.isStarted is started. This way it will only start once.

if (!Moralis.Core.isStarted) {
    await Moralis.start({
      apiKey: MORALIS_API_KEY,
    });
  }
1 Like

thank you,the error is solved.

1 Like