Registering Commands Issue

Hey there, I've recently started using sapphire, and I've used it before without running into this issue, but when I run my project (using bun, I've tried npm as well, same issue.) I continuously get the error
error: A compatible class export was not found. [C:\Users\iratm\OneDrive\Desktop\Unnamed\src\commands\util\test.ts]
error: A compatible class export was not found. [C:\Users\iratm\OneDrive\Desktop\Unnamed\src\commands\util\test.ts]
and I'm not sure what the issue is because I've followed the docs exactly besides changing the name of the class
export class TestCommand extends Command {...}
export class TestCommand extends Command {...}
8 Replies
ir
irOP7mo ago
Never mind - seems running the TS file directly causes it to mess up, but running the JS file works 👍
Favna
Favna7mo ago
Set your tsconfig target to ES2020 or higher. The default is ES3 which is very very old JS (before 2015)
ir
irOP7mo ago
I have mine set as NodeNext
Favna
Favna7mo ago
Target too? Pretty sure that's only module and moduleResolution
ir
irOP7mo ago
let me check I've set my target to both ES2020 and NextNode and I still get the error, the commands still register and work, that error is pretty annoying though, hogging up most of my console
Favna
Favna7mo ago
I'm not exactly sure then but it's definitely a config issue somewhere. I've ran bots with TS and Bun before. Well you figured it out I guess and that's most important
ir
irOP7mo ago
oh I also get
Error when loading 'C:\Users\iratm\OneDrive\Desktop\Unnamed\src\commands\moderation\TempBan.ts': 9 | LoaderErrorType2["UnknownStore"] = "UNKNOWN_STORE";
Error when loading 'C:\Users\iratm\OneDrive\Desktop\Unnamed\src\commands\moderation\TempBan.ts': 9 | LoaderErrorType2["UnknownStore"] = "UNKNOWN_STORE";
not sure if that's related to the issue I made this thread about but
Favna
Favna7mo ago
no idea what that is for but something isnt loading right maybe try generating a project with @sapphire/cli
Want results from more Discord servers?
Add your server