今天更新都 1.03.2012120 websocket illegal buffer, 退回1.0.3.2010240版本就是好的。
Error: illegal buffer
at Function.create_typed_array [as create] (message.js:formatted:1)
at Type.decode (message.js:formatted:1)
at Object.decode (message.js:formatted:1)
at Proto.decodeMsg (message.js:formatted:1)
at Socket.onMessage (message.js:formatted:1)
at Socket.<anonymous> (message.js:formatted:1)
at :30704/appservice/<socketTask.onmessage callback function>
at VM273 WAService.js:2
at VM273 WAService.js:2
at Set.forEach (<anonymous>)
不知道,底层做了什么修改,导致此问题。
登录环信,连接成功后 报错(之前的版本没有这个问题)
thirdScriptError
illegal buffer;at socketTask.onmessage callback function
Error: illegal buffer
at Function.c [as create] (http://127.0.0.1:45764/appservice/common/vendor.js:3675:181)
at v.decode (http://127.0.0.1:45764/appservice/common/vendor.js:3846:40)
at Function.<anonymous> (http://127.0.0.1:45764/appservice/common/vendor.js:4026:52)
at i.<anonymous> (http://127.0.0.1:45764/appservice/__dev__/WAService.js?t=wechat&s=1610507828130&v=2.10.4:2:127441)
at i.emit (http://127.0.0.1:45764/appservice/__dev__/WAService.js?t=wechat&s=1610507828130&v=2.10.4:2:599174)
at http://127.0.0.1:45764/appservice/__dev__/WAService.js?t=wechat&s=1610507828130&v=2.10.4:2:1257088
at http://127.0.0.1:45764/appservice/__dev__/WAService.js?t=wechat&s=1610507828130&v=2.10.4:2:584147
at c (http://127.0.0.1:45764/appservice/__dev__/asdebug.js:1:21017)
at r.<anonymous> (http://127.0.0.1:45764/appservice/__dev__/asdebug.js:1:21252)
at r.i.emit (http://127.0.0.1:45764/appservice/__dev__/asdebug.js:1:12137)
apiUrl: config.apiURL,
user: res.data.userName,
pwd: res.data.password,
grant_type: "password",
appKey: config.appkey,
success(msg) {},
error(err) {}
};
WebIM.conn.open(option); // 登陆环信
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
"eim": {
"version": "1.6.2",
"provider": "wx68ec0dccc4c6d15c"
}
问题解决,感觉是新版本的开发工具编译模式有调整,把 buffer instanceof ArrayBuffer 判断修改成 Object.prototype.toString.call(buffer) === "[object ArrayBuffer]" 就好了。