Skip to content

JSON parsing issue when we have message sent with open connection #8

Description

@mageshr2016

Hi - Thanks for the code. The client project works fine when there is no message sent from server (our own server) with open connection. But when there is a message sent with open connection, it throws a json parsing error. Could you pls help?

SyntaxError: Unexpected token H in JSON at position 0
    at JSON.parse (<anonymous>)
    at deserializer (WebSocketSubject.js:12)
    at tryCatcher (tryCatch.js:6)
    at WebSocket.socket.onmessage [as __zone_symbol__ON_PROPERTYmessage] (WebSocketSubject.js:174)
    at WebSocket.wrapFn (zone.js:1188)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:3815)
    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
    at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:496)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions