-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I am looking to develop on your excellent work - I am looking to update the version of MQTT.js.
But I am stuck at the first hurdle whilst trying to use browserify to create the bundle. I am missing something to do with the MQEmitter. I get the error:
Error: Cannot find module 'MQEmitter' from '/home/edge/src/polymer/mqtt-wrapper/mqtt-elements'
The workaround I have found so far is to run browserify -r ./node_modules/mqtt/lib/store.js:Store -r mqtt -r ./node_modules/mqemitter/mqemitter.js > dist/mqtt-elements-bundle.js and then change the string in the bundle from ./node_modules/mqemitter/mqemitter.js to MQEmitter.
I have updated mqtt.js to the latest version and all seems to be working...except subscriptions. That is the reason I wanted to try an updated mqtt version.
Publishing works fine, but subscriptions don't seem to work. I am testing with Mosquitto and AWS IoT. Both fail to subscribe. But I do not disconnect from the server. I see the binary frames sent in Chrome browser debugger. I am using your example code "injecting-mqtt-connection". I see no messages and {{item.subscribed}} remains false.
Any help would be appreciated for A) how to browserify correctly, and B) why subscriptions don't work for me.