JavaScript error: Cannot read property 'includes' of undefined
As the comments say: the javascript array object has no property objectId
.
Looking at the objects in this array it's clear that they have it, so to check if a certain element exists you can do so using Array.prototype.some method:
var exists = msgArr.some(o => o.objectId === data.objectId);