Closed
Description
Stack trace:
go.ts:72 panic: runtime error: index out of range [0] with length 0
go.ts:72
go.ts:72 goroutine 15 [running]:
go.ts:72 nhooyr.io/websocket.(*Conn).read(0x4b8000, 0xa1238, 0x438b00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
go.ts:72 /root/go/pkg/mod/nhooyr.io/websocket@v1.8.7/ws_js.go:132 +0x35
go.ts:72 nhooyr.io/websocket.(*Conn).Read(0x4b8000, 0xa1238, 0x438b00, 0x0, 0x2a0108, 0x18, 0x9eed8, 0x1b920004, 0x4b8000)
go.ts:72 /root/go/pkg/mod/nhooyr.io/websocket@v1.8.7/ws_js.go:107 +0xb
At the time where the panic happens, the message that is about to be read has already been received by the browser.
I looked at the relevant code and it looks a bit weird at first but could not find any obvious bug causing this.