Hello !
I'm trying to upgrade my nodebb 1.12.2 forum to 1.13.0 and I have after upgrade/build/start a bug with one of my plugins (which worked very well on 1.12.2).
Error message is :
2019-11-20T16:17:00.664Z [5678/15806] - error: uncaughtException: callback is not a function
TypeError: callback is not a function
at /home/yannick/MPstarClem/Developpement/nodebb/node_modules/nodebb-widget-online-users-YA/index.js:324:3
When I look in my plugin code, there is a callback call at the line number 324. A console.log(callback) just before this line gives {} which is really strange (obviously, it's not a function...).
Here is a simplified code to show how I get the problem... On the client side, there is a function which is called containing this :
if (socket.connected) {
socket.emit('plugins.onlineUsers.getOnlineUsers', function (err, data) {
console.log('Just a try');
}
);
}
This function calls a getOnlineUsers function on server side which contains this :
socketPlugins.onlineUsers.getOnlineUsers = function(socket, callback) {
console.log(callback); // Problem since nodebb 1.13.0 : callback is already {} here !!
UpdateUsersOnline(socket.uid, callback); // This function doesn't work because callback is not a function... This gives the error...
};
I can't find what have changed in nodebb 1.13.0 since 1.12.2 that makes this problem (I saw nothing relevant in breaking changes).
Any help ? Thanks !