中文
← Errors

F_SYSTEM_INVALID_METHOD_DECORATOR_TARGET

Invalid method decorator target

@Handler or @Catch is attached to something other than an instance method.

Updated 2 weeks ago

Reproduction

Method decorators need an instance so func can inject dependencies and invoke the method:

src/build.command.ts
import { Handler } from 'func'

class BuildCommand {
  @Handler()
  static run() {}
}

How to fix it

Use an instance method:

src/build.command.ts
class BuildCommand {
  @Handler()
  run() {}
}