[SOLVED] Cloud function hook does not work and legacy UI is unreachable to check

you can see the exact response in network tab from when the cloud function is called

I have changed the function to return just a string and updated it with cli, still empty result

moralis-admin-cli watch-cloud-file --moralisApiKey hv5NUpQedJNVvm6 --moralisApiSecret onVGyuA5qSptL2T --moralisSubdomain fw21fxfzipqu.usemoralis.com --autoSave ./FetchInitialData.js

Moralis code now:

Moralis.Cloud.define("FetchHistory", async (request) => {
  return "Hello, World!";
});

you can look in browser network tab for that request, you can also call that function with REST API with a simple url to check it how it works

https://v1docs.moralis.io/moralis-dapp/cloud-code/cloud-functions#call-via-rest-api

rest api request returning

{
code: 141,
error: "Invalid function: "FetchHistory"",
}

Can I just have an access to the old UI to set up it and check?

And this hook is no longer working as I understood, right? it is just not making any request as I checked

this error looks like the function is not present there, how do you upload the cloud code with the CLI, did it work before?

what is the server url?

It was working tomorrow yes and just stopped working today.
Here is the code of how I uploaded the file

moralis-admin-cli watch-cloud-file --moralisApiKey xxx --moralisApiSecret xxx --moralisSubdomain fw21fxfzipqu.usemoralis.com --autoSave ./FetchInitialData.js

here is the dapp URL - https://fw21fxfzipqu.usemoralis.com:2053/server

Moralis fetch function from the hook returning response undefined on the client and this in network tab - {"c":["main"],"r":[],"m":[]}, I thought it should return an error if something’s wrong with function, no?

there is no cloud code on that server

but terminal says File Uploaded Correctly and it was working just a day ago, so what has changed recently, and how I can make it work again? something wrong with the command?

try to run again that command that uploads the cloud code

done, terminal says everything uploaded well

the cloud code is updated now, it should return that hello world

HI @cryptokid I am also facing the same issue. Before there is option for legacy UI in moralis cloud, but its no longer available.

I am using Moralis.Cloud.run to call the cloud functions.

what is the exact issue that you have now?

I am getting “Invalid function:” error on my network.

I re-upload the cloud function folder via CLI but still it shows this function does not exists.

@cryptokid i am also facing the same issue.

Invalid function: “functionName”

https://legacy.moralis.io/ also not working

@DeathStar, @yogesh, you could use this url for a short period of time: legacybackup.moralis.io

1 Like

Thanks @cryptokid Now i have update cloud function and its working fine.

1 Like

Seems like this cli command to upload file and this hook to get function result do not work correctly, I had to use legacy UI and rest API with axios as well to get the same functionality back, also I have noticed that API has changed a bit in comparison with results from the hook, anyway now it is working as usual. I hope your legacy will not be closed completely in case of the same errors in the future.

1 Like