Skip to content

React Native: Client doesn't connect and no error is emitted #784

@emin93

Description

@emin93

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions