Skip to content

Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket' #3

@BrunoQuaresma

Description

@BrunoQuaresma

I have this code

window.app = {};

        app.BrainSocket = new BrainSocket(
                new WebSocket('ws://localhost:8080'),
                new BrainSocketPubSub()
        );

        app.BrainSocket.message('server.some_event',{data:'some_data'});

        app.BrainSocket.Event.listen('client.some_event',function(msg){
            //data returned from laravel
            console.log(msg);
                //msg.server.data has the data "This event was fired from the server"
        });

And this error in chrome

Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': already in CONNECTING state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions