Object literal may only specify known properties, and 'tasks' does not exist in type 'ClientOptions'

Hello there, I created a new project with sapphire new, using the minimal template. I'm trying to add the @sapphire/plugin-scheduled-tasks plugin. Following the doc, I use the npm install command and I added the register in the setup.ts. But when I try to add the tasks options in the SapphireClient (index.ts), I get the following error ;
error TS2353: Object literal may only specify known properties, and 'tasks' does not exist in type 'ClientOptions'.
error TS2353: Object literal may only specify known properties, and 'tasks' does not exist in type 'ClientOptions'.
Solution:
Interesting I think this happens because tsup outputs the file as .d.ts for CJS instead of .d.cts because it works just fine when using ESM For now if you add a line import '@sapphire/plugin-scheduled-tasks'; then it's fixed @Pandraghon pinging @vladdy here as well for reference...
No description
No description
Jump to solution
5 Replies
Solution
Favna
Favna5mo ago
Interesting I think this happens because tsup outputs the file as .d.ts for CJS instead of .d.cts because it works just fine when using ESM For now if you add a line import '@sapphire/plugin-scheduled-tasks'; then it's fixed @Pandraghon pinging @vladdy here as well for reference
No description
No description
vladdy
vladdy5mo ago
oof yeah
Favna
Favna5mo ago
Seeing as we already use rollup-type-bundler in the package though I can fix it there. I can make it so it's configurable what the output file extension should be.
Pandraghon
Pandraghon5mo ago
Nice, it works! Thanks for this solution!
Favna
Favna5mo ago
PR created to fix it for real @Pandraghon (see #plugins-development for link )