znibbles / 10-node-in-max

13 stars 3 forks source link

mqtt-publisher: Cannot read property 'publish' of undefined. #10

Open leo-nerd opened 4 years ago

leo-nerd commented 4 years ago

Hi. Thanks for the tutorials. I followed your 4-mqtt tutorial to the letter (including setting it up backwards!) and I get this error message in the node.script UI for mqtt-publisher: Cannot read property 'publish' of undefined.

As though it cannot understand what client is?

I'm new to this but it looks like a catch-22: if the script isn't running it cannot instantiate the client, but when the script is ran it gives the error. Where should we start?

Thanks

leo-nerd commented 4 years ago

(if I comment out the publish method first, then run the script, then connect, then uncomment the publish method, then we're good)

julianrubisch commented 4 years ago

Sorry for the difficulties. I will have a look when I find the time (not easy atm)