ActionRowBuilder type error

Any idea why this I'm getting this type error? It's the components array that is complaining. The components type works fine with other types of SelectMenuBuilders.
Type 'ActionRowBuilder<ChannelSelectMenuBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<ChannelSelectMenuBuilder>' but required in type 'ActionRowData<MessageActionRowComponentData | MessageActionRowComponentBuilder>'.ts(2322)
index.d.ts(280, 3): 'type' is declared here.

const row: ActionRowBuilder<ChannelSelectMenuBuilder>
Type 'ActionRowBuilder<ChannelSelectMenuBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<ChannelSelectMenuBuilder>' but required in type 'ActionRowData<MessageActionRowComponentData | MessageActionRowComponentBuilder>'.ts(2322)
index.d.ts(280, 3): 'type' is declared here.

const row: ActionRowBuilder<ChannelSelectMenuBuilder>
const channelMenu = new ChannelSelectMenuBuilder()
.setCustomId('test')
.setPlaceholder('select a channel')
.setMinValues(1)
.setMaxValues(1)
.setChannelTypes(ChannelType.GuildText);

const row = new ActionRowBuilder<ChannelSelectMenuBuilder>().setComponents(channelMenu);

return interaction.editReply({ content: 'hello', components: [row] });
const channelMenu = new ChannelSelectMenuBuilder()
.setCustomId('test')
.setPlaceholder('select a channel')
.setMinValues(1)
.setMaxValues(1)
.setChannelTypes(ChannelType.GuildText);

const row = new ActionRowBuilder<ChannelSelectMenuBuilder>().setComponents(channelMenu);

return interaction.editReply({ content: 'hello', components: [row] });
3 Replies
d.js toolkit
d.js toolkit7mo 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! - Marked as resolved by OP
xx_lavaboy_xx123
restart your ts server
CarelessInternet
it didn't help here's my tsconfig.json if it helps:
{
"compilerOptions": {
"experimentalDecorators": true,
"paths": {
"@/*": ["./src/*"]
},
/* Base Options: */
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"verbatimModuleSyntax": true,
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
/* Strictness */
"strict": true,
"noUncheckedIndexedAccess": true,
/* If NOT transpiling with TypeScript: */
"moduleResolution": "Bundler",
"module": "ESNext",
"noEmit": true,
/* If your code doesn't run in the DOM: */
"lib": ["es2022"]
// /* If you're building for a library: */
// "declaration": true,
// /* If you're building for a library in a monorepo: */
// "composite": true,
// "declarationMap": true
}
}
{
"compilerOptions": {
"experimentalDecorators": true,
"paths": {
"@/*": ["./src/*"]
},
/* Base Options: */
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"verbatimModuleSyntax": true,
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
/* Strictness */
"strict": true,
"noUncheckedIndexedAccess": true,
/* If NOT transpiling with TypeScript: */
"moduleResolution": "Bundler",
"module": "ESNext",
"noEmit": true,
/* If your code doesn't run in the DOM: */
"lib": ["es2022"]
// /* If you're building for a library: */
// "declaration": true,
// /* If you're building for a library in a monorepo: */
// "composite": true,
// "declarationMap": true
}
}
ah yeah my bad there was a version mismatch between my package that uses discord.js and the bot application thanks for pointing me towards the solution