discordjs / voice

Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Apache License 2.0
327 stars 110 forks source link

[Types] WebSocket types error #182

Closed ibaraki-douji closed 3 years ago

ibaraki-douji commented 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.

vaporoxx commented 3 years ago

You probably didn't enable esModuleInterop in your tsconfig, which allows importing it like that.