Typing - Question message

So I have this and I am confused entirely what the reason is. Import is
import { EmbedBuilder, Guild, Message, User } from 'discord.js';
import { EmbedBuilder, Guild, Message, User } from 'discord.js';
No description
Solution:
Okay so using npm instead of yarn worked, I was on latest v4 but it may have been my yarn lock file
Jump to solution
3 Replies
kyra
kyra7mo ago
Your application uses ESM (and thus the ESM version of discord.js) while a dependency you’re using is loading the CJS version of the library. Generally most people shouldn’t have this issue, all Sapphire does ESM and CJS bundles precisely to mitigate this issue. Can you show us more code so we can investigate further?
Slime
SlimeOP5mo ago
I'm at work currently but I'll send it when I'm home! But it's a generic send message function that takes in a message and embeds The code is
export function sendLoadingMessage(message: Message): Promise<typeof message> {
return send(message, { embeds: [new EmbedBuilder().setDescription(pickRandom(RandomLoadingMessage)).setColor('#FF0000')] });
}
export function sendLoadingMessage(message: Message): Promise<typeof message> {
return send(message, { embeds: [new EmbedBuilder().setDescription(pickRandom(RandomLoadingMessage)).setColor('#FF0000')] });
}
I think I took it off an example And import { EmbedBuilder, Guild, Message, User } from 'discord.js'; Sapphire related libraries are
"@sapphire/cli": "^1.9.3",
"@sapphire/eslint-config": "^5.0.5",
"@sapphire/prettier-config": "^2.0.0",
"@sapphire/ts-config": "^5.0.1",
"@sapphire/cli": "^1.9.3",
"@sapphire/eslint-config": "^5.0.5",
"@sapphire/prettier-config": "^2.0.0",
"@sapphire/ts-config": "^5.0.1",
It's been a while but I had some time to check this
Solution
Slime
Slime5mo ago
Okay so using npm instead of yarn worked, I was on latest v4 but it may have been my yarn lock file
Want results from more Discord servers?
Add your server