vline im:recv event error: Uncaught TypeError: Cannot call method 'log' of undefined in vline.js

StackOverflow https://stackoverflow.com/questions/19599262

  •  01-07-2022
  •  | 
  •  

문제

When receiving a vLine im, I experience an uncaught TypeError.

Set up the event handler:

this.client_.on('recv:im', this.onMessageRecv, this);

onMessageRecv is:

function (aEvent) {
      var msg = event.message;
      var sender = msg.getSender();

      this.displayError(sender.getDisplayName(),
                        sender.getThumbnailUrl(),
                        msg.getBody());
}

(displayError is merely calling alert)

Not sure if this is helpful or not, but here is a screengrab of the debugger: http://i.imgur.com/iGCn2dt.png

도움이 되었습니까?

해결책

It looks like you're passing the event argument with the name aEvent and then attempting to reference it as event.message instead of aEvent.message.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top