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

356
Views
Uncaught TypeError: setInterval(...).unref is not a function

I was trying to use discord.js to get current client ID, I installed discord.js, @discordjs/rest discord-api-types and here's my code

const Discord = require("discord.js");
const client = new Discord.Client();

client.login("Your Token");

const commands = require("./commands.json");

const rest = new REST({ "version": "9" }).setToken(process.env.TOKEN);

(async () => {
    try {
        console.log("Started refreshing application (/) commands.");
        if (process.argv.length) {
            await rest.put(
                Routes.applicationGuildCommands(process.env.CLIENT_ID, process.argv[0]), { "body": commands }
            );
        } else {
            await rest.put(
                Routes.applicationCommands(process.env.CLIENT_ID), { "body": commands }
            );
        }
        console.log("Successfully reloaded application (/) commands.");
    } catch (error) {
        console.error(error);
    }
})();

I am getting this error:

Uncaught TypeError: setInterval(...).unref is not a function at new RESTManager ([PATH]\node_modules\discord.js\src\rest\RESTManager.js:23:51) at new BaseClient ([PATH]\node_modules\discord.js\src\client\BaseClient.js:27:17) at new Client ([PATH]\node_modules\discord.js\src\client\Client.js:38:5) at file:///[PATH]/assets/app.js:2:16

about 4 years ago · Juan Pablo Isaza
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!