mqtt-exec icon indicating copy to clipboard operation
mqtt-exec copied to clipboard

TypeError: Object true has no method 'replace'

Open kenfehling opened this issue 8 years ago • 1 comments

Hi, thanks for this library. Trying the example, when I run mosquitto_pub I get:

/usr/local/lib/node_modules/mqtt-exec/mqtt-exec.js:59
var message = message.replace(/"/g, "\\\"");   
                      ^

TypeError: Object true has no method 'replace'

It looks like the message "true" becomes a buffer object and not a string. (<Buffer 74 72 75 65>)

kenfehling avatar May 01 '16 00:05 kenfehling

This patch fixes this issue for me: https://github.com/denschu/mqtt-exec/pull/4

kenfehling avatar May 01 '16 00:05 kenfehling