Hi,
Since yesterday a strange behavior started occurring, I have a simple cloud function to retrieve NFT Categories (code below), and in one page works fine returning the expected results, on another page throws an error.
Moralis.Cloud.define("getNFTCategories", async () => {
const results = [];
const query = new Moralis.Query("NFTCategory");
query.equalTo("active", true);
query.select("objectId", "name", "slug");
const queryResults = await query.find({useMasterKey:true});
for (let i = 0; i < queryResults.length; ++i) {
const item = {
id: queryResults[i].id,
name: queryResults[i].attributes.name,
slug: queryResults[i].attributes.slug,
};
results.push(item);
}
return results;
});
Error in Log:
Error: Invalid function: "getNftCategories"
at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:119:13)
at /moralis-server/lib/PromiseRouter.js:85:20
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Also, I donāt know if is the correct behavior or not, or if is related with the problem above, but when I try to Update/Restart Server it says There is a Cloud Function Error (Syntax/Undefined Variables) on your code, in order to Update/Restart your server fix the error first, You can check the full Log on the Dashboard -> Logs -> Error even if I removed all the Cloud Functions.
Thank you for your help.