#TypeError: ActionRowBuilder is not a constructor

53 messages · Page 1 of 1 (latest)

foggy flume
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

next perch
#

node -v

#

v19.4.0

south ridge
#

how have you imported it?

next perch
#

npm list discord.js

south ridge
#

also what's your disordjs version
^ run it on your cmd

next perch
next perch
south ridge
next perch
#

code

south ridge
#

what

next perch
#
client.info(interaction, {
                description: ":small_blue_diamond: **Scegli la chiave da modificare**",
}, {
                components: [
                    <ActionRowData<ChannelSelectMenuComponentData>>{
                        type: ComponentType.ActionRow,
                        components: [
                            {
                                type: conf.type,
                                customId: `selectnewkey:${key}`,
                                minValues: 1,
                                maxValues: isArray ? 10 : 1,
                                placeholder: "Seleziona",
                                //@ts-ignore
                                ...(conf.metadata ? conf.metadata : {})
                            },
                        ]
                    },
                ],
                ephemeral: true
})
#

this function calls interactions reply

#
info(ctx:RepliableInteraction,data:EmbedData, other?:InteractionReplyOptions){
        ctx.reply({
            embeds:[
                new Info(data)
            ], 
            ...other
        })
    }
olive bay
#

Where are you using ActionRowBuilder

next perch
#

And this error apperead casually

#

While before the bot worked perfectly

tranquil topaz
#

Show full error

winter vergeBOT
#
Edoardo Limortacci#5983 (1016303870592438354)
TypeError: ActionRowBuilder is not a constructor
    at createComponentBuilder (/home/edoardo/Desktop/Ammiragli/node_modules/discord.js/src/util/Components.js:114:14)
    at /home/edoardo/Desktop/Ammiragli/node_modules/discord.js/src/structures/ActionRowBuilder.js:15:40
    at Array.map (<anonymous>)
    at new ActionRowBuilder (/home/edoardo/Desktop/Ammiragli/node_modules/discord.js/src/structures/ActionRowBuilder.js:15:31)
    at /home/edoardo/Desktop/Ammiragli/node_modules/discord.js/src/structures/MessagePayload.js:137:84
    at Array.map (<anonymous>)
    at MessagePayload.resolveBody (/home/edoardo/Desktop/Ammiragli/node_modules/discord.js/src/structures/MessagePayload.js:137:49)
    at StringSelectMenuInteraction.reply (/home/edoardo/Desktop/Ammiragli/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:109:56)
    at ExtendedClient.info (/home/edoardo/Desktop/Ammiragli/dist/Client/Client.js:36:13)
    at run (/home/edoardo/Desktop/Ammiragli/dist/Interactions/Context/Configuration/ConfigurationMenu.js:32:20)
next perch
tranquil topaz
#

ConfigurationMenu.js line 32

runic mauve
#

Probably you have changed the source code. Try to reinstall discord.js

next perch
next perch
#

I've tried also with docker but has the same issue

next perch
winter vergeBOT
#
Edoardo Limortacci#5983 (1016303870592438354)
{
                components: [
                    <ActionRowData<ChannelSelectMenuComponentData>>{
                        type: ComponentType.ActionRow,
                        components: [
                            {
                                type: conf.type,
                                customId: `selectnewkey:${key}`,
                                minValues: 1,
                                maxValues: isArray ? 10 : 1,
                                placeholder: "Seleziona",
                                //@ts-ignore
                                ...(conf.metadata ? conf.metadata : {})
                            },
                        ]
                    },
                ],
                ephemeral: true
            }
tranquil topaz
#

Can you do npm uni @discordjs/builders?

runic mauve
#

uni

tranquil topaz
#

Perhaps is a version conflict issue

next perch
#

Let me uninstall it

next perch
tranquil topaz
#

And can you show your Components.js (internal file), send it in a pastebin

trail jackalBOT
#

To share long code snippets use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks.

runic mauve
#

Can you show structures/ActionRowBuilder.js?

#

also internal

next perch
runic mauve
#

Do you use esm (import) or cjs (require)?

next perch
#

could it be a typescript compile issue ?

#

maybe I should change the target ?

#

that's my tsconfig.json

#
{
  "compilerOptions": {
    "target": "ES6",       
    "module": "commonjs",                               
    "rootDir": "./src",                              
    "resolveJsonModule": true,                                 
    "outDir": "./dist",            
    "esModuleInterop": true,                            
    "forceConsistentCasingInFileNames": true, 
    "strict": true,      
    "skipLibCheck": true                                
  },
}
#

@runic mauve

#

I've fixed it

#

I have deleted nodemodules

#

and used "npm i"

#

and now it works