Can I use discord.js as an ES modules? And make use of import and export statements?
The above.
7 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!yes
how
ahhh, wait i've just go tto use the default export
alright, thank you
Is there any other methods though?
As that of course really does not look clean,
I'm not exactly sure what you're asking
sorry, really tired, and i'm not very good at explaining anyway - so i'm getting this error.
However, I was wondering if there's any other way of just import all discord.js as
import DJS from 'discord.js'
(as a default export).
As I'd really like to make use of ES modules.your error comes from
Flags
not existing
what you name the default export is entirely up to you
you're also free to import specific exports using import { ... } from "discord.js"
syntaxahh jeez, alright - thanks so much