Skip to content

SyntaxError: JSON Parse error: Unexpected identifier "continuation" #172

@technicallyty

Description

@technicallyty

I'm using "@heroiclabs/nakama-js": "^2.6.1" to build a client in TypeScript. I use sockets to make calls to RPC's on the Nakama backend. For some reason, I randomly get these errors spit into my console:

SyntaxError: JSON Parse error: Unexpected identifier "continuation"
      at /Users/REDACTED/client/node_modules/@heroiclabs/nakama-js/dist/nakama-js.esm.mjs:3013:24
3008 |     return this._socket.onmessage;
3009 |   }
3010 |   set onMessage(value) {
3011 |     if (value) {
3012 |       this._socket.onmessage = (evt) => {
3013 |         const message = JSON.parse(evt.data);
                            ^

my Go-based server is logging:
(using github.com/heroiclabs/nakama-common v1.27.0)

{"level":"debug","ts":"2023-09-19T21:37:11.533Z","caller":"server/session_ws.go:204","msg":"Error reading message from client","uid":"8fa3b6e6-695c-475a-96ca-e3afcba467b7","sid":"a8198a91-5734-11ee-9dcd-006100a0eb06","error":"websocket: continuation after FIN"}

It's really unclear why this is happening, and the error message doesn't provide much context to help me out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions