Hi!
I updated version few minutes ago and now I have this error on my console (without change anything on my code base).
The error is:

This is how I create client.
client = mqtt.connect('wss://mqtt.crystal.io:12346', {
username: ...,
password: ...,
clientId: ...,
reconnectPeriod: ...,
rejectUnauthorized: ...
});
Thanks to your work.
From 馃嚠馃嚬
which browser are you using? Can you upload an example of this regression?
Browser: Google Chrome 57.0.2987.133
I don't change anything on my code.
What can I do to help you with ?
If you want, I can send you this.
https://gist.github.com/CVarisco/60f10ef15cd1523fbf627f467d962b0d
@CVarisco tests are green, I can't replicate. In order to fix, I need to replicate the bug. Can you provide me with a bare-minimum example where this does not work? I need a full example that I can run to diagnose the problem.
I'm texting you on Gitter to explain the issue.
I can't send the full application, because is too large.
If you can, answer me on Gitter.
Thanks a lot
This was fixed by blocking the version of readable-stream to v2.2.6, so maybe there is an issue with webpack and the changes we recently did to readable-stream.
@CVarisco could I get a copy of your webpack config to see what might be causing issues?
@RangerMauve of course!
https://gist.github.com/CVarisco/87cc9f91ea3cbd92ad276f3fb83eb4ef
It's a little confused, sorry
Why is this closed? I see no resolution... just a roll back.
@flodonsky can you upload a full example to reproduce the issue?
This can be reproduced with the Webpack example on the Readme.
https://github.com/mqttjs/MQTT.js#browser
@yohei1126 there might be some other condition, that's working for me.
Anyway, this should be fixed in [email protected]. Wipe your node_modules folder and you should be ok.
@mcollina No, unfortunately I work on a proprietary code base. However it seems like I'm not the only one having the issue, and I don't think fixing a dependency at a certain version is a solution at all. This means that a dependency manager like NPM is useless as the engineer then has to, post npm install, manually go into their package.json and magically know to set readable-stream to version 2.2.9. That's ridiculous. I suggest that since the culprit is known as a dependency of this package, that the solution lies in that relationship and should be investigated thoroughly to the changes and implicates that have effected this dependent.
@flodonsky When bugs are fixed in modules, it's common practice to update your version in order to get the fix. You don't need to manually go into package.json since npm install will fetch the latest version of the dependency with the bug fix.
As for the relationship to readable-stream, it's the only module for using Node streams outside of the node core, and anybody trying to use streams has no choice but to depend on it at some point.
@flodonsky please moderate your language. "That's ridiculous" is not accepted. You are not forced to use Node, NPM, MQTT.js or any of the like, if those are not of your liking. I'm not responsible for your code not working, you are.
This bug has been fixed over the weekend on readable-stream, and it just requires a big npm update or a wipe of node_modules. I think you should appreciate a 24-hours turnaround on a bug.
I rolled back the package and in temporary fixed MQTT.js @2.5.2, and it was just a bug... I was speaking of the approach to the 'solution' not the fix that's been implemented. I absolutely appreciate a fix so quickly and being able to line my packages back up to update instead of fixing the version in a package manager! Not only that, I appreciate this package being available at all so I don't have to write up the code and hooks myself into the node core, don't think I'm unappreciative!! And my code _continues_ to work just fine...
-- EDIT--
Closed related issue.