title: Parse-server Cloud Code Error 141 Invalid Function
body: <p>I am running parse-server on Heroku, I am working on implementing a custom cloud code function, however every implementation returns invalid function code: 141, Version:1.12.0</p>
  
  <p>I have successfully gotten the "hello" function to work, including 1 change I made to it:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Parse.Cloud.define('hello', function(req, res) {
    console.log("received.........");
    res.success('Hi');
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>The custom function I am trying to get working is a simple query to my database:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Parse.Cloud.define("titleQuery", function(request, response) {
    var query = new Parse.Query("StudentNotes");
    query.equalTo("title", request.params.title);
    query.find({
      success: function(results) {
  
        console.log("received........." + results);
  
        response.success(results);
      },
      error: function() {
        console.log("received........." + error);
  
        response.error("title lookup failed");
      }
    });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I run this on iOS with the following code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>        PFCloud.callFunctionInBackground("titleQuery", withParameters: ["title": "testTitle"]) {
            (response: AnyObject ? , error : NSError ? ) - &gt; Void in
              let hello = response // as? String
            print(hello)
  
          }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am querying my database in class "StudentNotes" for object title with the name "testTitle", I know for a fact that that object exists, however due to it throwing error 141 I do not receive anything.  Any help would be greatly appreciated.</p>
  
  <p>EDIT2: I have gotten custom cloud functions to work, however I cannot get any queries to my database to work.  <strong>Can anyone post a confirmed working query that returns an object?  Perhaps from the _User table so that I can copy/paste and ensure that my cloud code can access my database?</strong></p>
  
  <p>My process:
  I edit the Main.js file and add in my cloud function.
  Then i commit &amp; push (successfully)
  finally i restart my Heroku server
  Then i still get an error 141 invalid function return</p>