eclipse / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.14k stars 468 forks source link

Uncaught ReferenceError: wireMessage is not defined #168

Closed ctwj closed 5 years ago

ctwj commented 5 years ago

hello: i'm a newer, so i just use the example code in project. when connect everything is ok, but when i try to send something , i got the error Uncaught ReferenceError: wireMessage is not defined Connect:

    this.client =new Paho.MQTT.Client('localhost', 8083, '')
   this.client.connect({
      onSuccess: this.onConnect,
      userName: 'test',
      password: 'test'
    });

Publish:

let message = new Paho.MQTT.Message('1');
    message.destinationName = "YZ_CONTROL";
    this.client.send(message);

ERROR:

Uncaught ReferenceError: wireMessage is not defined

# code where error happen
wireMessage = new WireMessage(MESSAGE_TYPE.PUBLISH);
wireMessage.payloadMessage = message;
hgascoigne commented 5 years ago

Hey there 👋

I ran into the same issue and submitted a PR #170

ctwj commented 5 years ago

Ok , thankyou verymuch!