Arjan van de Wiel
Arjan van de Wiel

Reputation: 21

Uncaught TypeError: Object #<Object> has no method '_isNullOrUndefined'

When running an aftersave on Parse.com, i'm sometimes getting the error:

Uncaught TypeError: Object #<Object> has no method '_isNullOrUndefined'

Most of the time, there is no problem at all.

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'

And my piece of 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();
});

The strange this is that i don't even use the method '_isNullOrUndefined'.

Upvotes: 2

Views: 567

Answers (1)

Mo Nazemi
Mo Nazemi

Reputation: 2717

I started getting the same error today on Cloud . This seems to be a known Parse server bug whereas a server runs out of memory. Unfortunately Facebook engineers consider this a low priority bug to fix as far as it syas here: https://developers.facebook.com/bugs/1653218834940491/

Also reported today: https://developers.facebook.com/bugs/978099338900195/

Upvotes: 1

Related Questions