pomelo-weixin-client
pomelo-weixin-client copied to clipboard
this.socket.send is not a function错误频繁出现
this.socket.send is not a function这个错误频繁出现,我之前一直没去当一回事,但是一直有一些用户反应频繁掉线,不好连接啥的。希望能获得您的帮助。
这个应该是socket连接中断了,此时需要进行重新连接,如果有进展欢迎发PR~
我之前一直是用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
@xiaobear250 clone本项目后执行npm run build和npm run package即可得到release的版本,其中代码压缩可以在webpack配置中关闭
谢谢。 在package.json中,script下增加"dev": "webpack --mode none --config webpack.config.js",然后npm run dev即可获得没有任何压缩的release版本。