Setting Client commands in ES Module
I am trying to set commands in an ESModule:
And getting this error:
This is what the
./commands/utility/convert.js
looks like:
Is there any issue with using const { default: command } = await import(filePath);
or is something else the problem? Thank you!4 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!import { codeblock } from "../../utils/utilities"; you are not importing correctly the file.It missing the extention, like
.js
I changed it to
import { codeblock } from "../../utils/utilities.js";
but still getting same error.
tysm!