Parse JS SDK: 不能使用Master Key,没有提供

Parse JS SDK: Cannot use the Master Key, it has not been provided

我需要在我的 angular2 应用程序中使用 masterKey,但我无法将其传递给 initialize 函数,我也无法 google 找出原因。 来自 package.json"parse": "~1.9.2".

初始化:

import {Parse} from '~/node_modules/parse/dist/parse';

@Injectable()
export class TFCloudService {
    constructor() {
        this.parse = Parse;

        Parse.initialize(appConfig.parse.appId, null, appConfig.parse.masterKey);
        Parse.serverURL = appConfig.parse.clientServerUrl;
        Parse.liveQueryServerURL = appConfig.parse.liveQueryServerURL;
    }
}

错误来源:

this.edittedUser.save(null, {useMasterKey: true})
.then((user) => {
    console.log(user);
});

错误文本: Error: Cannot use the Master Key, it has not been provided.

appConfig.parse.masterKey 工作正常,我也用硬编码密钥检查了那行,但得到了相同的结果。

居然猜对了那个key的正确传递方式:

Parse.initialize(appConfig.parse.appId);
Parse.masterKey = appConfig.parse.masterKey;