Incompatibility Between ActionRowBuilder and interaction.reply()

I accidentally upgraded one of my bots to the latest version of discord.js by doing a downgrade and started getting an error in the type of the InteractionReplyOptions object on the components field, the error indicates that the ActionRowBuilder<ButtonBuilder> object is not compatible with the type expected by the function. In particular, it indicates that the type property is missing, even though the object was constructed correctly according to the documentation. It seems to be a compatibility problem between the type generated by the builder and the type expected by interaction.reply. I am using the same version of discord.js and the same code as provided by the discord.js guide but it still does not work. The error:
No overload matches this call.
Overload 1 of 2, '(options: InteractionReplyOptions & { fetchReply: true; }): Promise<Message<boolean>>', gave the following error.
Type 'ActionRowBuilder<ButtonBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<ButtonBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
Overload 2 of 2, '(options: string | InteractionReplyOptions | MessagePayload): Promise<InteractionResponse<boolean>>', gave the following error.
Type 'ActionRowBuilder<ButtonBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<ButtonBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.ts(2769)
index.d.ts(292, 3): 'type' is declared here.
index.d.ts(292, 3): 'type' is declared here.
const row: ActionRowBuilder<ButtonBuilder>
No overload matches this call.
Overload 1 of 2, '(options: InteractionReplyOptions & { fetchReply: true; }): Promise<Message<boolean>>', gave the following error.
Type 'ActionRowBuilder<ButtonBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<ButtonBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.
Overload 2 of 2, '(options: string | InteractionReplyOptions | MessagePayload): Promise<InteractionResponse<boolean>>', gave the following error.
Type 'ActionRowBuilder<ButtonBuilder>' is not assignable to type 'APIActionRowComponent<APIMessageActionRowComponent> | JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<...>'.
Property 'type' is missing in type 'ActionRowBuilder<ButtonBuilder>' but required in type 'ActionRowData<MessageActionRowComponentBuilder | MessageActionRowComponentData>'.ts(2769)
index.d.ts(292, 3): 'type' is declared here.
index.d.ts(292, 3): 'type' is declared here.
const row: ActionRowBuilder<ButtonBuilder>
No description
No description
No description
No description
4 Replies
d.js toolkit
d.js toolkit6mo 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!
frig
frigOP6mo ago
no sorry I meant that I first upgraded and then downgraded to an earlier version (14.18.0) to the one you see in the screenshot
frig
frigOP6mo ago
No description
frig
frigOP6mo ago
so how do I solve it?

Did you find this page helpful?