eclipse / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.15k stars 467 forks source link

Cannot read property 'subscribe' of undefined #112

Closed StevenWash closed 7 years ago

StevenWash commented 7 years ago

Hi @jpwsutton @knolleary , I have some problems when I use the client.subscribe,it will occur that 'Cannot read property 'subscribe' of undefined'.Then I find the client is undefined.But,I have use the client to connect,here are my code: image When I click connect ,it will call the method 'connect()'.So,when I click connect in my web page,it will occur problems like that: image

And I guess that these method named 'onConnect,disconnect,onConnectionLost..' are belong to callback method,in these methods the client was undefine.But how can I deal these problems?

Any one can help me?Thank you very much!

StevenWash commented 7 years ago

Sorry,I have dealed these problems. Thank you !

jpwsutton commented 7 years ago

@StevenWash Out of interest, what was your solution?

mer30boy commented 3 years ago

I have same problem .what was your solution?