Hi,
After crawling through various issues, i made it to build a commonjs2 browser variant, which I've used in my React Native application:
webpack mqtt.js --output-library mqtt --output-library-target commonjs2 --output-filename mqtt-browser.js
I use it like this:
import mqtt from 'mqtt/dist/mqtt-browser';
const client = mqtt.connect('wss://iot.eclipse.org');
client.on('connect', () => console.log('connected')); // No console.log
client.on('error', error => console.log(error)); // No console.log
Does anybody know what the issue could be? As soon as I can get this fixed, I'll add a guide on how to use this library with React Native! 😃
AB#8916595