ActionRowBuilder error for Modal

Hello ! When I upgrade to 14.8.0, I have a strange error for ActionRowBuilder (modal). My code :
const suggestionTitle = new TextInputBuilder()
.setCustomId("suggestion_title")
.setLabel("Titre de la suggestion")
.setStyle(TextInputStyle.Short);

const titleRow = new ActionRowBuilder().addComponents(suggestionTitle);

const suggestionModal = new ModalBuilder()
.setCustomId("suggestion")
.setTitle("Suggestion");

suggestionModal.addComponents(titleRow)

await interaction.showModal(suggestionModal);
const suggestionTitle = new TextInputBuilder()
.setCustomId("suggestion_title")
.setLabel("Titre de la suggestion")
.setStyle(TextInputStyle.Short);

const titleRow = new ActionRowBuilder().addComponents(suggestionTitle);

const suggestionModal = new ModalBuilder()
.setCustomId("suggestion")
.setTitle("Suggestion");

suggestionModal.addComponents(titleRow)

await interaction.showModal(suggestionModal);
The error:
error TS2345: Argument of type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to parameter of type 'RestOrArray<ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>>'.
Type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to type '[(ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>)[]]'.
Type 'ActionRowBuilder<AnyComponentBuilder>' is missing the following properties from type '(ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>)[]': length, pop, push, concat, and 29 more.

21 suggestionModal.addComponents(titleRow)
error TS2345: Argument of type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to parameter of type 'RestOrArray<ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>>'.
Type '[ActionRowBuilder<AnyComponentBuilder>]' is not assignable to type '[(ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>)[]]'.
Type 'ActionRowBuilder<AnyComponentBuilder>' is missing the following properties from type '(ActionRowBuilder<TextInputBuilder> | APIActionRowComponent<APITextInputComponent>)[]': length, pop, push, concat, and 29 more.

21 suggestionModal.addComponents(titleRow)
Thanks in advance ^^ Mysterious_Dev
3 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Parogo_72
Parogo_722y ago
You need to specify the type of the ActionRowBuilder new ActionRowBuilder<TextInputBuilder>()
Mysterious_Dev
Mysterious_DevOP2y ago
Thanks dude ^^.
Want results from more Discord servers?
Add your server