中文
← Errors

F_SYSTEM_INVALID_FIELD_DECORATOR_TARGET

Invalid field decorator target

A field option or validator decorator is attached to something other than an instance property.

Updated 2 weeks ago

Reproduction

Field decorators cannot collect values into static properties:

src/options.ts
import { Flag } from 'func'

class Options {
  @Flag()
  static verbose = false
}

How to fix it

Move the decorator and value to an instance property:

src/options.ts
class Options {
  @Flag()
  verbose = false
}