Component Type Error (TS)

I posted this in the regular help channel but it got buried without a lot of help. I'm running into an odd ts issue with components
Property 'type' is missing in type 'ActionRowBuilder<MessageActionRowComponentBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.ts(2322)
index.d.ts(301, 3): 'type' is declared here.
Property 'type' is missing in type 'ActionRowBuilder<MessageActionRowComponentBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.ts(2322)
index.d.ts(301, 3): 'type' is declared here.
its worked fine with regular js, even with ts-check turned on. the code doesn't seem to be out of the ordinary. I'm on 14.18.0 right now
msg.reply({ components: [
new Discord.ActionRowBuilder<Discord.ButtonBuilder>().addComponents(
new Discord.ButtonBuilder().setLabel("Testing").setCustomId("testButton").setStyle(Discord.ButtonStyle.Primary)
)
]})
msg.reply({ components: [
new Discord.ActionRowBuilder<Discord.ButtonBuilder>().addComponents(
new Discord.ButtonBuilder().setLabel("Testing").setCustomId("testButton").setStyle(Discord.ButtonStyle.Primary)
)
]})
any clues? TS version 5.8.3, also tried with 5.4
7 Replies
d.js toolkit
d.js toolkit4mo ago
BobbyTheCatfish
BobbyTheCatfishOP4mo ago
DJS version 14.18.0 Node version 20.13.1 Casting the payload to Discord.InteractionEditReplyOptions for interaction replies does work, but it's hacky and I'd rather not have to
treble/luna
treble/luna4mo ago
How are you importing the builders
BobbyTheCatfish
BobbyTheCatfishOP4mo ago
import Discord, { ButtonBuilder, ActionRowBuilder } from "discord.js"; Should I be directly importing from the builder package?
treble/luna
treble/luna4mo ago
did you install builders separately at one point? no, you should always be importing from djs
BobbyTheCatfish
BobbyTheCatfishOP4mo ago
Nah it's a clean install
├─┬ @discordjs/builders@1.11.2 extraneous
│ ├─┬ @discordjs/formatters@0.6.1
│ │ └── discord-api-types@0.38.17
│ └── discord-api-types@0.38.17 extraneous
└─┬ discord.js@14.18.0
├─┬ @discordjs/builders@1.11.2
│ └── discord-api-types@0.38.17
├─┬ @discordjs/rest@2.5.1
│ └── discord-api-types@0.38.17
├─┬ @discordjs/ws@1.2.3
│ └── discord-api-types@0.38.17
└── discord-api-types@0.37.120
├─┬ @discordjs/builders@1.11.2 extraneous
│ ├─┬ @discordjs/formatters@0.6.1
│ │ └── discord-api-types@0.38.17
│ └── discord-api-types@0.38.17 extraneous
└─┬ discord.js@14.18.0
├─┬ @discordjs/builders@1.11.2
│ └── discord-api-types@0.38.17
├─┬ @discordjs/rest@2.5.1
│ └── discord-api-types@0.38.17
├─┬ @discordjs/ws@1.2.3
│ └── discord-api-types@0.38.17
└── discord-api-types@0.37.120
I had done that to test stuff after my previous message, but I removed it shortly after. Not sure why it's still showing up there. I guess it was a weird quirk with bun's package manager? I uninstalled DJS and everything related to it and just installed my command interface that has a peer dependency for DJS and it worked. thanks for helping me out!
d.js toolkit
d.js toolkit4mo ago
The thread owner has marked this issue as solved.

Did you find this page helpful?