中文
← Errors

F_SYSTEM_CANNOT_INFER_VALUE_TYPE

Cannot infer value type

A value property does not expose supported TypeScript decorator metadata.

Updated

Reproduction

@Value() can use only the emitted String and Number runtime types:

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

class Options {
  @Value()
  when: Date = new Date()
}

How to fix it

Declare the property as string or number so TypeScript emits supported decorator metadata:

src/options.ts
class Options {
  @Value()
  when: string = ''
}

Ensure emitDecoratorMetadata is enabled. For booleans, use @Flag(); for repeated values, declare string[] with @ArrayString() or number[] with @ArrayNumber().