Closed ibaraki-douji closed 3 years ago
I just install the npm package and in the Types (dist/index.d.ts) and the WebSocket import is invalid.
Initial :
import WebSocket, { MessageEvent } from 'ws';
And what it should be :
import { MessageEvent } from 'ws'; import WebSocket = require('ws');
Because ws package use export = for his lib.
ws
export =
You probably didn't enable esModuleInterop in your tsconfig, which allows importing it like that.
esModuleInterop
I just install the npm package and in the Types (dist/index.d.ts) and the WebSocket import is invalid.
Initial :
And what it should be :
Because
ws
package useexport =
for his lib.