Cannot read property 'method' of null?
时间 | 客户端版本 | 小程序版本 | 版本错误次数 | 总错误次数 | 次数占比 | 错误内容 |
---|---|---|---|---|---|---|
2019-08-23 | 7.0.6 | 1.5.8 | 3 | 3 | 100.00% | Cannot read property 'method' of null;at socketTask.onopen callback function TypeError: Cannot read property 'method' of null at Object._buildWebsocketFrame (https://usr/app-service.js:1086:19965) at Object.internalSend (https://usr/app-service.js:1086:20603) at Function.<anonymous> (https://usr/app-service.js:1086:21402) |
2 回复
你好,能复现么?麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
onLoad: function (options) {
var that = this;
that.userId = wx.getStorageSync(“userId”);
this.connect();
wx.onSocketOpen(function (res) { // 链接同时注册用户
console.log(‘sk链接成功’)
that.socketOpen = true
//发送数据
var uid = that.userId
var msg = { userId: uid, type: 1 };
wx.sendSocketMessage({
data: JSON.stringify(msg)
})
})