中文
← Errors

F_SYSTEM_CANNOT_INFER_VALUE_TYPE

Cannot infer value type

A @Value property has no supported runtime type and does not declare one explicitly.

Updated 2 weeks ago

Reproduction

@Value() can infer only the supported primitive runtime types:

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

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

How to fix it

Pass a supported parser type explicitly and keep the property type compatible:

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

Use String, Number, or Boolean. For repeated strings, use @ArrayValue().