0

I'm trying to run some very basic cloud code function on my parse-server and I get the same error every time: 141 Invalid function. I'm just adding a main.js file with my function in the cloud directory and trying to call it using Postman, but it looks like the file is not even called.

I've tried locally and on a docker, if the function exist or not I get the same result, and tried restarting the docker container after adding the code. I also tried adding a body to the request with parameters like master and functionName.

Here's my cloud code function (cloud/main.js):

Parse.Cloud.define('hello', function(req, res) {
  return "function called";
});

Calling the function with a POST request on https://myurl/parse/functions/hello and getting:

{
    "code": 141,
    "error": "Invalid function: \"hello\""
}
2
  • What version of Parse Server are you running? Commented May 3, 2019 at 17:00
  • I'm running 3.3.0 Commented May 6, 2019 at 7:28

1 Answer 1

1

The response object has been removed from Parse Server Cloud Code post v3.0.0.

Your Cloud Code function should look like this...

Parse.Cloud.define("hello", async (request) => {
  return "function called";
});

Please read the migration guide for more details on updating your cloud code to v3.0.0 or above.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.