#TypeError: ActionRowBuilder is not a constructor
53 messages · Page 1 of 1 (latest)
how have you imported it?
npm list discord.js
also what's your disordjs version
^ run it on your cmd
[email protected] /home/edoardo/Desktop/Ammiragli
├─┬ [email protected]
│ └── [email protected] deduped
└── [email protected]
let me organize the post before
.
what
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
})
}
Where are you using ActionRowBuilder
I'm not using it actually!
And this error apperead casually
While before the bot worked perfectly
Show full error
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)
Oh thx
ConfigurationMenu.js line 32
Probably you have changed the source code. Try to reinstall discord.js
Calls the function client.info
Did it already
I've tried also with docker but has the same issue
@tranquil topaz line 32 is client.info(...
{
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
}
Can you do npm uni @discordjs/builders?
uni
Perhaps is a version conflict issue
Let me uninstall it
same issue
And can you show your Components.js (internal file), send it in a pastebin
nvm
it seems ok ?
Do you use esm (import) or cjs (require)?
esm
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