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.

akairo does not support ES6 syntax

See original GitHub issue

Using latest master & djs master Node 13.11.0:

import { AkairoClient } from 'discord-akairo';

results in

SyntaxError: The requested module 'discord-akairo' does not provide an export named 'AkairoClient'

as workaround you have to do

import Akairo from 'discord-akairo';

class GideonClient extends Akairo.AkairoClient {...

also the commandhandler uses require() on the files instead of import, resulting in

Error: [ERR_REQUIRE_ESM] [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\Adrian\code\Gideon\akairo\cmds  \admin\abm.js
  require() of ES modules is not supported.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
papaiacommented, May 25, 2020

We could maybe allow cjs and mjs extensions, combined with a check: if it’s an mjs, we await import, otherwise we require. As for the importing of Akairo, we could maybe do something like discordjs/discord.js#3998.

0reactions
1Computer1commented, Jul 11, 2020

import does not support reloading as of the moment. Its not a deal breaker, but I’d rather not touch it for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"es6" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
ES6 syntax examples - discord.js Guide
If you check the code above, it's currently doing things like 'Guild name: ' + interaction.guild.name and 'Your username: ' + interaction.user.
Read more >
Untitled
Discord doesn't allow you to change the font by default, but using this generator ... are just those available through the markdown syntax....
Read more >
Untitled
As we are exploiting the syntax highlighting, the colors you can use are limited. js doesn't officially support using client. Find the Discord...
Read more >
discordjs bot github
Discord bot draft that does not contain ready-made commands, compatible with discord. ... The syntax of the above command can be found here....
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