nsupportedCacheOverwriteWarning

got this error stack on fresh ts project , anyone could tell me whats wrong ?
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for GuildManager is unsupported and breaks functionality.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for RoleManager is unsupported and breaks functionality.
Discord bot is ready! 🤖
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for PermissionOverwriteManager is unsupported and breaks functionality.
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for GuildManager is unsupported and breaks functionality.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for RoleManager is unsupported and breaks functionality.
Discord bot is ready! 🤖
(node:1604) UnsupportedCacheOverwriteWarning: Overriding the cache handling for PermissionOverwriteManager is unsupported and breaks functionality.
app.ts
import { Client, GatewayIntentBits, Guild } from "discord.js";
import { commands } from "./commands";
import { deployCommands } from "./deploy-commands";

const client = new Client({
intents: [
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
],
});

client.once("ready", async () => {

const guild = client.guilds.cache.get('1145437116210352140')?.id as string

console.log("Discord bot is ready! 🤖");
await deployCommands({ guildId: guild })
});

client.on("interactionCreate", async (interaction) => {
if (!interaction.isCommand()) {
return;
}
const { commandName } = interaction;
if (commands[commandName as keyof typeof commands]) {
commands[commandName as keyof typeof commands].execute(interaction);
}
});

client.login("XD")
import { Client, GatewayIntentBits, Guild } from "discord.js";
import { commands } from "./commands";
import { deployCommands } from "./deploy-commands";

const client = new Client({
intents: [
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
],
});

client.once("ready", async () => {

const guild = client.guilds.cache.get('1145437116210352140')?.id as string

console.log("Discord bot is ready! 🤖");
await deployCommands({ guildId: guild })
});

client.on("interactionCreate", async (interaction) => {
if (!interaction.isCommand()) {
return;
}
const { commandName } = interaction;
if (commands[commandName as keyof typeof commands]) {
commands[commandName as keyof typeof commands].execute(interaction);
}
});

client.login("XD")
7 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
monbrey
monbrey15mo ago
Could you turn on --trace-warnings? The code youve shown shouldnt be doing that
shullex
shullexOP15mo ago
@jiralite Yes. So using npx ts-node src/app.ts will "fix" the issue basically?
GitHub
GitHub15mo ago
<:issue_open:852714230280486942> #9770 in discordjs/discord.js by SomeAspy opened <t:1691872976:R> UnsupportedCacheOverwriteWarning when using TSX
shullex
shullexOP15mo ago
Well, i actually tested it and errors were Away.. 😂
monbrey
monbrey15mo ago
You should compile your typescript instead of using tsx or ts-node
shullex
shullexOP15mo ago
Thanks for your assistance mans So basically tsc before prod? Well ts is new to me. I'd love to have more ts related questions. Am i allowed to ask for specific ts approaches in the fórum here? For specific solutions for d.js? Alr, thanks a lot Have a good one
Want results from more Discord servers?
Add your server