Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

859
Views
TypeError: MessageActionRow is not a constructor

Im using discord V13 and im getting this error. (If you prefer you can look at the code in this link: https://sourceb.in/8w8wKS1Wmy)

Main file:

// main.js

const Discord = require('discord.js'); 

The command file:

// command 

const {
    MessageActionRow,
    MessageButton
} = require('discord.js');
module.exports = {
    name: 'commands',
    permissions: [],
    description: "this sends help!",
    aliases: ['cmd', 'cmdinfo', 'commandsinfo'],
    execute(client, message, cmd, args, Discord) {

            const utilbtn = new MessageActionRow()
                .addComponents(
                    new MessageButton()
                    .setCustomId('primary')
                    .setLabel('Primary')
                    .setStyle('PRIMAMRY'),
                    
                );

            const newEmbed = new Discord.MessageEmbed()
                .setTitle('**Commands**')

            message.channel.send({
                embed: [newEmbed],
                component: [utilbtn]
            });
        }
    }
}

The error message:

// the error 

const utilbtn = new MessageActionRow()
                ^           

TypeError: MessageActionRow is not a constructor
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I cannot imagine how this is not working, unless if you are using the wrong version, consider running:

npm i discord.js@13.1.0

I've tried running both:

const { MessageActionRow } = require('discord.js');
// undefined
new MessageActionRow()
// MessageActionRow { type: 'ACTION_ROW', components: [] }

The commented lines are the response when running node in console. Maybe try checking package.json, should have a line like the following:

"discord.js": "^13.1.0"
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!