Invalid cloud function returned in api console

I have a cloud function which worked before but now I get “invalid function” when I call it from the console and I dont know why.

Moralis.Cloud.define("isContract", async request => {
  if (!request.params.address) return;
  try {
    const result = await web3.eth.getCode(request.params.address);
    if (result !== "0x") {
      return true;
    }
    return false;
  } catch (error) {
    logger.info("Error: " + error);
  }
});


console.log(await Parse.Cloud.run("isContract", {address:"0x738533F4Ead5Fd7B44C33FaF9DEd642a9f5c597c"}))

you can get that error when cloud code doesn’t work, or the function is not present

any other function works fine in cloud code

whats weird is that it worked before and now it doesnt anymore. I can not see any errors in the cloud function code either.

what is the server url?

https://kb5kpiz0r1ry.usemoralis.com:2053/server

it looks like there is an error in cloud code somewhere
TypeError: Moralis.Cloud.job.define is not a function

1 Like

thank you, didnt see that popping up anywhere. Do you know if there is any limit to how many cloud functions I can write? Im on a production server

there isn’t a limit on the number of function from what I know

1 Like

thanks mate, appreciatethe help