Sorry !
I copied dist/mqtt.js to my weapp's project then required it. like that
var mqtt = require('../../MQTT/mqtt.js')
const client = mqtt.connect('wss://****:8884')
but it can not work . Console show the error:
sdk uncaught third Error
WS is not a constructor
TypeError: WS is not a constructor
Would you please provide a simple working example of weapp? thinks
Hi, I would suggest looking at some of the existing issues related to weapp to see if there are any examples there.
@guakeliao
var mqtt = require('../../MQTT/mqtt.js')
const client = mqtt.connect('wss://****:8884')
use wxs or wx in weapp
Most helpful comment
@guakeliao
use wxs or wx in weapp