discordjs / voice

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

[Types] WebSocket types error #182

Closed ibaraki-douji closed 2 years ago

ibaraki-douji commented 2 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 2 years ago

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