Having trouble debugging a Meteor method on the server side. While debugging in the client (using Chrome), the debugger progresses until the 4th line of code ("Meteor.call") and then immediately jumps back to the 2nd line ("convlist:function()"), skipping over the 2nd debugger instruction. There are no errors in the client or server consoles. I've also tried using the server-side debugger, but the running process never seems to reach it (Server debug at http://localhost:8080/debug?port=5858). Any advice would be greatly appreciated.
Client Side:
Template.conversationList.helpers({
convlist: function(){
debugger;
Meteor.call('getConvList', function(error, result){
if(error){
alert('Error');
} else {
debugger; // used for evaluating the result variable
return result;
}
});
//edited 3rd debugger;
debugger;
}});
Server Side:
if (Meteor.isServer) {
Meteor.methods({
getConvList: function(){
debugger;
let myUser = new Array();
myUser.push(Meteor.user()._id);
var newConv = Conversations.aggregate([{ "$match" : { "users": {"$in": [Meteor.user()._id]}}}, { "$project": { lstmsg:1, "conversator": {"$setDifference": ["$users", myUser] }}}]);
return newConv;
}
});
}