Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Parse.Config return undefined?

Recently Parse.com has announced the Parse.Config feature. However, in cloud code, trying to access Parse.Config always returns undefined.

Parse.Cloud.define("search", function(req, res) {
    Parse.Config.get().then(function(config) { 
        // This line is never reached.
    });
}

Did I do something wrong?

like image 615
Khanh Hua Avatar asked Sep 10 '14 06:09

Khanh Hua


1 Answers

Your Cloud Code is probably running with an older version of the SDK that does not yet support Parse Config.

You can set the version of the SDK to use as follows:

  1. Open a terminal, cd into the directory of your project
  2. Run parse jssdk 1.3.0
  3. Re-delpoy your code

This will set the SDK version your code uses to v1.3.0 of the Parse JavaScript SDK and Parse Config should work then.

like image 153
Björn Kaiser Avatar answered Oct 04 '22 21:10

Björn Kaiser