messagecommand generated from CLI error

I just started out with Sapphire and i was trying to use the CLI to generate a messagecommand but ran into this error
Unable to resolve signature of class decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 1.
Unable to resolve signature of class decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 1.
No description
No description
Solution:
I just started out with Sapphire and i was trying to use the CLI to generate a messagecommand but ran into this error
Unable to resolve signature of class decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 1.
Unable to resolve signature of class decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 1.
...
No description
No description
Jump to solution
8 Replies
Krish
Krish15mo ago
what's your TS version?
Oreo ™
Oreo ™15mo ago
4.8.2 ok i upgraded it to 5.0.3 still got the same error i downgraded to 4.9.5 and still no luck
Ararou
Ararou15mo ago
try adding a name in it name: 'command_name',
Oreo ™
Oreo ™15mo ago
nothing still the same error
@ApplyOptions<Command.Options>({
name: 'name',
description: 'A basic command'
})
@ApplyOptions<Command.Options>({
name: 'name',
description: 'A basic command'
})
i have no idea why it doesnt work i checked the bots on github that use sapphire and i copied their ts version and their decorator version ok so i found a fix
{
"extends": "@sapphire/ts-config",
"compilerOptions": {
"ignoreDeprecations": "5.0",
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo"
},
"include": ["src"]
}
{
"extends": "@sapphire/ts-config",
"compilerOptions": {
"ignoreDeprecations": "5.0",
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo"
},
"include": ["src"]
}
but this seems sketch since i have to use ignoreDeprecations
Favna
Favna15mo ago
you have to use TS 4.9 for now and also you have to make VSC use your node_modules tsc by default it uses the built in one which is 5.x we're working on updating our libraries for TS 5.x support but arent there yet so first install TS 4.9.5 then in vsc do "select typescript version" in the command palette and select node_modules 4.9.5
Krish
Krish15mo ago
add it in tags until support for v5 is released
Favna
Favna15mo ago
Feel free to PR it
Oreo ™
Oreo ™15mo ago
thanks oh ok, i marked the wrong message