添加云代码时,为什么会出现此错误?

时间:2016-08-09 23:51:41

标签: ios heroku parse-platform parse-server

我刚刚从解析迁移到heroku,一切正常,但是当我添加云代码时,我在iOS应用Optional(Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.})中收到此错误。这只发生在我添加云代码并且没有任何内容加载时,但在取出它之后它完全正常。

var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://xxxxxxx',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'xxxxxxxxx',
masterKey: process.env.MASTER_KEY || 'xxxxxxxx', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',  // Don't forget to change to https if needed
liveQuery: {
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
  }
});


let config = ParseClientConfiguration(block: {
        (ParseMutableClientConfiguration) -> Void in
        ParseMutableClientConfiguration.applicationId = "xxxxxxxxx";
        ParseMutableClientConfiguration.clientKey = "xxxxxxxxxx";
        ParseMutableClientConfiguration.server = "http://yyyyyyy.herokuapp.com/parse";
    });
Parse.initialize(with: config);

0 个答案:

没有答案