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 toolkit10mo 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
monbrey10mo ago
Could you turn on --trace-warnings? The code youve shown shouldnt be doing that
shullex
shullex10mo ago
@jiralite Yes. So using npx ts-node src/app.ts will "fix" the issue basically?
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
shullex
shullex10mo ago
Well, i actually tested it and errors were Away.. 😂
monbrey
monbrey10mo ago
You should compile your typescript instead of using tsx or ts-node
shullex
shullex10mo 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