I'm trying to create a WebSocket server with the ws package, but I keep getting this error:
Namespace has no exported member 'Server'
I've tried importing the ws package in different ways, but none work. I can't seem to figure out how to make the error disappear. What am I doing wrong here?
import * as http from 'http';
import * as WebSocket from 'ws';
export class Ws {
private server: http.Server;
private wss: WebSocket.Server;
public start(): void {
this.server = http.createServer();
this.wss = new WebSocket.Server({ noServer: true });
}
}