sclausen / ngx-mqtt

This library isn't just a wrapper around MQTT.js for angular. It uses observables and takes care of subscription handling and message routing.

Home Page:https://sclausen.github.io/ngx-mqtt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import MqttModule Problem Angular 11

CarlosOliverHM opened this issue · comments

Current behavior

When I add MqttModule.forRoot(MQTT_SERVICE_OPTIONS) in app.module.ts I get:

Captura de Pantalla 2021-02-13 a la(s) 20 47 08

Expected behavior

No problems in localhost:4200

Environment

import { IMqttServiceOptions, MqttModule} from "ngx-mqtt";
import { environment as env } from '../environments/environment';

const MQTT_SERVICE_OPTIONS: IMqttServiceOptions = {
  hostname: env.mqtt.server,
  port: env.mqtt.port,
  protocol: (env.mqtt.protocol === "wss") ? "wss" : "ws",
  path: '',
};

imports: [
    ...
    MqttModule.forRoot(MQTT_SERVICE_OPTIONS),
   ...
  ],

ngx-mqtt version: 7.0.9

It is not possible to install the new version in Angular 11, because has the problem of Angular 11 compatibility with ngx-mqtt #17 issue.
Captura de Pantalla 2021-02-13 a la(s) 20 51 47

Captura de Pantalla 2021-02-13 a la(s) 20 52 08

Duplicated by #170