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

Bots using CommonJS requiring the package are broken #231

Closed Chooks22 closed 2 years ago

Chooks22 commented 2 years ago

Issue description

229 broke CommonJS require.

/project/node_modules/@discordjs/voice/dist/index.js:1
import path from "path";
^^^^^^

SyntaxError: Cannot use import statement outside a module

Code sample

require('@discordjs/voice');

@discordjs/voice version

0.7.3

Node.js version

16.13.0

Operating system

Linux

Priority this issue should have

High (immediate attention needed)

cvzxeov commented 2 years ago

I have the same thing... image

iCrawl commented 2 years ago

This was rather annoying to fix without writing a lot of code, I hope this is finally fixed in 0.7.4 0.7.5 now 👍