Skip to content

[Bug]: Uniapp subpackage cannot use local mqtt.js file #1994

Open
@kerwin58

Description

@kerwin58

MQTTjs Version

v4.2.1

Broker

EMQX

Environment

NodeJS

Description

Unable to reference the methods in mqtt.js

Minimal Reproduction

Image

import * as mqtt from './mqtt.js'
mqttData.client = mqtt.connect(
      hosts,
      mqttData.options
  );

Image

Debug logs

detail.vue:494 Uncaught (in promise) TypeError: mqtt.connect is not a function
at Proxy.connect (detail.vue:494:30)
at getInfo (detail.vue:880:12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions