0
votes

I wrote this cloud funtion for demo purpose.

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

But it always returns this error message

{
    "code": 141,
    "error": "res.success is not a function"
}

What's wrong?

1

1 Answers

5
votes

Starting parse server 3.0 there is no response object anymore. Simply return the value and it will work.

Parse.Cloud.define(‘hello’, (req) => {
     return ‘ok’;
});

For more informations, see the migration guide: https://github.com/parse-community/parse-server/blob/master/3.0.0.md