You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm facing an issue where in a browser environment MQTT library still try to use ws instead of the browser native WebSocket for the web socket connection.
After digging in the codebase I found out that the following code to understand if the code is running on node or in a browser is NOT taking care of any bundler other than Webpack (for instance I'm on Parcel 2 and is not working):
In addition to this I don't understand the usage of process.title at all, I investigated a bit about this but I wasn't able to find any meaningful documentation or hint of its usage.
I think is worth having a safer way to check whether the code is running on the browser or not.
The text was updated successfully, but these errors were encountered:
Hi,
I'm facing an issue where in a browser environment MQTT library still try to use
ws
instead of the browser nativeWebSocket
for the web socket connection.After digging in the codebase I found out that the following code to understand if the code is running on
node
or in a browser is NOT taking care of any bundler other than Webpack (for instance I'm on Parcel 2 and is not working):MQTT.js/lib/connect/ws.js
Line 18 in b3ce3da
In addition to this I don't understand the usage of
process.title
at all, I investigated a bit about this but I wasn't able to find any meaningful documentation or hint of its usage.I think is worth having a safer way to check whether the code is running on the browser or not.
The text was updated successfully, but these errors were encountered: