pomelo-weixin-client icon indicating copy to clipboard operation
pomelo-weixin-client copied to clipboard

this.socket.send is not a function错误频繁出现

Open xiaobear250 opened this issue 6 years ago • 5 comments

微信截图_20190713164325 this.socket.send is not a function这个错误频繁出现,我之前一直没去当一回事,但是一直有一些用户反应频繁掉线,不好连接啥的。希望能获得您的帮助。

xiaobear250 avatar Jul 13 '19 08:07 xiaobear250

这个应该是socket连接中断了,此时需要进行重新连接,如果有进展欢迎发PR~

wangsijie avatar Sep 23 '19 07:09 wangsijie

我之前一直是用releases版本,为了调试这个问题,我试着用微信小程序的npm支持,结果一直连接不上去。跟踪发现是在执行handshake函数中的this.send时,提示this.socket为undefined。 试着输出此刻的this和之前的this,感觉不是同一个对象。 和微信构建npm过程中的 var _this = _possibleConstructorReturn(this, (Pomelo.proto || Object.getPrototypeOf(Pomelo)).call(this, args));不知是否有关。 希望能够提供无加密版的releases版本给我调试之前的BUG。

xiaobear250 avatar Oct 15 '19 09:10 xiaobear250

如果可以希望加个微信,方便交流。我微信号是xiaobear250

xiaobear250 avatar Oct 15 '19 10:10 xiaobear250

@xiaobear250 clone本项目后执行npm run build和npm run package即可得到release的版本,其中代码压缩可以在webpack配置中关闭

wangsijie avatar Oct 16 '19 00:10 wangsijie

谢谢。 在package.json中,script下增加"dev": "webpack --mode none --config webpack.config.js",然后npm run dev即可获得没有任何压缩的release版本。

xiaobear250 avatar Oct 16 '19 01:10 xiaobear250