{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Error: AMQJS0010E WebSocket is not supported by this browser.\n at new ClientImpl (/var/user/node_modules/paho-mqtt/paho-mqtt.js:772:11)\n at new Client (/var/user/node_modules/paho-mqtt/paho-mqtt.js:1785:17)\n at Runtime.exports.main [as handler] (/var/user/index.js:9:16)\n at Runtime.handleOnce (/var/runtime/node12/Runtime.engine.js:219:23)\n at Timeout._onTimeout (/var/runtime/node12/Runtime.engine.js:56:12)\n at listOnTimeout (internal/timers.js:549:17)\n at processTimers (internal/timers.js:492:7)","statusCode":430}
云开发是nodejs环境,没有wx对象
云函数算服务端,找服务端mqttSDK,你用的这俩都是客户端的
{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Error: AMQJS0010E WebSocket is not supported by this browser.\n at new ClientImpl (/var/user/node_modules/paho-mqtt/paho-mqtt.js:772:11)\n at new Client (/var/user/node_modules/paho-mqtt/paho-mqtt.js:1785:17)\n at Runtime.exports.main [as handler] (/var/user/index.js:9:16)\n at Runtime.handleOnce (/var/runtime/node12/Runtime.engine.js:219:23)\n at Timeout._onTimeout (/var/runtime/node12/Runtime.engine.js:56:12)\n at listOnTimeout (internal/timers.js:549:17)\n at processTimers (internal/timers.js:492:7)","statusCode":430}
云函数使用安装paho-mqtt包 不能正常连接mqtt服务器