question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module 'discord.js' has no exported member 'Routes'.

See original GitHub issue

Which package is this bug report for?

discord.js

Issue description

Hi guys, i hope you are doing well.

I found a problem with types

image

image

Code sample

import { REST } from "@discordjs/rest";
import { Routes } from "discord.js";

const commands = [
   {
      name: "ping",
      description: "Replies with Pong!",
   },
];

const rest = new REST({ version: "10" }).setToken("token");

(async () => {
   try {
      console.log("Started refreshing application (/) commands.");

      await rest.put(Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID), {
         body: commands,
      });

      console.log("Successfully reloaded application (/) commands.");
   } catch (error) {
      console.error(error);
   }
})();

Package version

“discord.js”: “^13.8.0”

Node.js version

v16.15.0

Operating system

No response

Priority this issue should have

High (immediate attention needed)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

No Intents

I have tested this issue on a development release

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pedroleinarcommented, Jun 16, 2022

I just follow the main readme.

In the main readme you are showing an example that doesn’t work, you know ?

Sorry my english and thank you very much for the help

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module '"discord.js"' has no exported member 'Intents'
js "' has no exported member 'Intents'. My code is: import dotenv from 'dotenv'; const bot = new Client ...
Read more >
Module '"discord.js"' has no exported member 'ClientApplication'.
I just got the next error while initializing my discord bot: Module '"discord.js"' has no exported member 'ClientApplication'. Code or steps to ...
Read more >
Module has no exported member error in TypeScript
The error "Module has no exported member" occurs when we try to import a member that doesn't exist in the specified module. To...
Read more >
Command handling - discord.js Guide
Collection is used to store and efficiently retrieve commands for execution. Next, using the modules imported above, dynamically retrieve your ...
Read more >
module.exports – How to Export in Node.js and JavaScript
The exports keyword is a reference to the exports object in the modules object. By doing exports.value1 = value1 , it added the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found