Cannot read property 'method' of null?
发布于 7 年前 作者 yong62 14020 次浏览 来自 官方Issues
时间客户端版本小程序版本版本错误次数总错误次数 

次数占比错误内容
2019-08-237.0.61.5.833100.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)

})

})

回到顶部