在Parse.com上运行aftersave时,我有时会收到错误:
Uncaught TypeError: Object #<Object> has no method '_isNullOrUndefined'
大部分时间都没有问题。
E2015-12-07T05:51:27.294Z]v2062 before_save triggered for Messages as master:
Input:
{
"original":{
"ACL":{
"TOKH12Rp70":{
"read":true,
"write":true
},
"TAMklaH39":{
"read":true
}
},
"createdAt":"2015-11-14T11:05:17.242Z",
"from":{
"__type":"Pointer",
"className":"_User",
"objectId":"TOKH12Rp70"
},
"message":"Hi",
"objectId":"67yyXKTTY",
"read":true,
"score":{
"__type":"Pointer",
"className":"Scores",
"objectId":"RqUP2X8T86"
},
"to":{
"__type":"Pointer",
"className":"_User",
"objectId":"TAMklaH39"
},
"updatedAt":"2015-12-06T18:56:45.405Z"
},
"update":{
"read":true
}
}
Result: Uncaught TypeError: Object #<Object> has no method '_isNullOrUndefined'
我的Cloud Code JS
Parse.Cloud.beforeSave('Messages', function(request, response){
if(request.object.isNew()){
// FIRST, Set the current score
var last_score = request.user.get('last_score');
request.object.set('score', last_score);
cl('Beforesave: added score');
// SECOND, let the receiver know
var from_id = request.object.get('from').id;
var to_id = request.object.get('to').id;
var message = request.object.get('from').get('first_name') + ': ' + request.object.get('message');
var action = 'new_message';
send_push_message(from_id, to_id, message, action);
cl('Beforesave: send message');
}
response.success();
});
奇怪的是,我甚至没有使用方法&#39; _isNullOrUndefined&#39;。
答案 0 :(得分:1)
我今天开始在Cloud上遇到同样的错误。这似乎是一个已知的Parse服务器错误,而服务器耗尽了内存。不幸的是,Facebook工程师认为这是一个低优先级的错误,可以解决这里的syas:https://developers.facebook.com/bugs/1653218834940491/