Hello, I am using hook const { fetch, data } = useMoralisCloudFunction(<FunctionName>);
and it was okay but suddenly stopped working, data is empty and fetch result is undefined. I was using cli to update file, and there was no error, but still does not work. And I canāt open Legacy UI to check if there is any cloud function working now or not. There is no obvious error, just an empty result even if the database contains data, and a couple of days ago everything was fine
you can look in network tab in browser to see if there is a specific error
you can add a new cloud function that only return a string and check it to see if it works, this way you could know that the cloud code is properly uploaded
As I said there is no error with request thus no error in the network tab, so the only way to check is to add new cloud function?
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