Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Error - this.socket.onMessage is not a function #13

@Wathsara

Description

@Wathsara
var initialize = "null";
const socket:rpc.IWebSocket = new WebSocket('ws://localhost:8080/mypath');
const reader = new rpc.WebSocketMessageReader(socket);
const writer = new rpc.WebSocketMessageWriter(socket);
const logger = new rpc.ConsoleLogger();
const connection = rpc.createMessageConnection(reader, writer, logger);
const notification = new rpc.NotificationType<string, void>('onInitialize');
connection.onNotification(notification, (param: any) => {
	initialize=param; // This prints Hello World
});
connection.listen();

When I tried the above code which is in the readme file it gives an error like before

Request textDocument/completion failed with message: this.socket.onMessage is not a function

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