#StringSelectMenuBuilder error

9 messages · Page 1 of 1 (latest)

quick minnow
#

error:

data.components[0].components[1][COMPONENT_LAYOUT_WITDH_EXCEEDED]: the specified component exceeds the maximum witdh

Select menu code

const selectMenuOptions = pshipData.pshipTypes.map(category => (
         new StringSelectMenuOptionBuilder()
        .setLabel(category.categoryName)
        .setValue(category.categoryName)
        ));
        const selectMenu = new StringSelectMenuBuilder()
            .setCustomId('category_select')
            .setPlaceholder('Select a category')
            .addOptions(...selectMenuOptions);

        // a button to save and create
        const button = new ButtonBuilder()
            .setCustomId('save_button')
            .setLabel('Save & Create')
            .setStyle(ButtonStyle.Success);

        //  an action row with select menu and button
        const row = new ActionRowBuilder()
        .setComponents(selectMenu, button);
full walrusBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
quick minnow
#

I'm trying to give options for some categoryNames from my db

obtuse cliff
#

an action row can have only 1 select menu or up to 5 buttons

quick minnow
#

And if I want to add both?

#

There's only one select menu and 1 button

obtuse cliff
#

make another action row

quick minnow
#

Let me try

obtuse cliff
#

one for the select menu, one for the button