-
-
Notifications
You must be signed in to change notification settings - Fork 111
Doesn't find libraries when using ES modules #227
Comments
This is related to this issue with esbuild evanw/esbuild#946 Affected files are: There is a workaround described in the esbuild issue but maybe we should consider migrating to dynamic import syntax or reading and parsing json files manually |
Same here on Linux (Debian 10 Buster). |
Since it seems several other people are having this issue as well, would it be possible to add a workaround for now and then perhaps look at other options later (I assume those would take longer than adding a few config lines)? |
Is this a workaround in your build or a workaround we're expected to run in our environment? |
I found a rather elegant solution to avoid modifying all your code to CJS. import { createRequire } from "module";
const {
joinVoiceChannel,
createAudioPlayer,
createAudioResource,
entersState,
VoiceConnectionStatus,
NoSubscriberBehavior,
} = createRequire(import.meta.url)("@discordjs/voice"); |
Let me reopen this issue to notify of a strange behavior that may occur when using Just to be sure, this should remain a temporary solution until the problem is fixed on esbuild. |
Issue description
What the title says. When using ES modules, this package can't seem to find the supporting libraries.
i.e.
even though
@discordjs/opus
is installed.See repro.
Code sample
No response
@discordjs/voice version
0.7.2
Node.js version
v16.6.1, TS 4.4.4
Operating system
macOS
Priority this issue should have
Medium (should be fixed soon)
The text was updated successfully, but these errors were encountered: