Open imp-guru opened 10 years ago
Ahum. can you please send an example that shows the issue?
Broken example: http://jsfiddle.net/lgbeno/6d2akk1n/
Functional example: http://jsfiddle.net/lgbeno/85nw5teu/1/
See the console for errors. I am using Chrome Version 37.0.2062.120
I see the error on both.
It seems a browserify issue. Which version of browserify are you using?
5.11.1
I think this is the latest
I updated the link, maybe after you read it. try this for a functional example: http://jsfiddle.net/lgbeno/85nw5teu/1/
Can you point me to the exact line that is messing up with that?
314
of what file? Can you point me to github-link?
Original Browserified version: https://github.com/imp-guru/mows_test/blob/gh-pages/mows_browserified.js
To avoid this issue, I just commented out lines 314-317 these changes are here: https://github.com/imp-guru/mows_test/blob/gh-pages/mows_fixed.js
Got that. Can you assemble a pull-request against MQTT.js that keeps that behavior but in a browser-safe way?
I'm afraid that is a beyond my level of understanding of how this whole process is working.
Maybe this evening I can go through mqtt.js and find a correlation but I really don't know what is happening under the hood with browserify yet.
So these are the lines in MQTT.js that are causing the issue: https://github.com/adamvr/MQTT.js/blob/master/lib/client.js#L301-L303
Hi,
i was seeing a very strange issue with a version of mows that I recently got off of npm and then ran through browserify.
I was getting the error "Invalid subscriptions - invalid qos"
after much debugging, I finally found the root cause, for some reason, the browser was evaluating this statement as true:
even though toString.call(callback) was actually '[object Function]'
anyway, I commented out the following and things are working great: //if (toString.call(callback) == '[object Object]') { // opts = callback; // callback = nop; //}
This is sort of a hack but at the moment, I do not plan using these arguments.