Skip to content
Latchkey

tsc TS5024: Compiler option 'x' requires a value of type ... in CI

TS5024 is a tsconfig validation error: a compiler option exists but was given a value of the wrong type. This differs from TS5023 (an unknown option name) because the option is valid, only its value is not.

What this error means

tsc fails before type-checking with "error TS5024: Compiler option 'target' requires a value of type string." or a similar type, naming the option and the type it expects.

tsc
error TS5024: Compiler option 'target' requires a value of type string.

Common causes

A boolean given where a string is expected (or vice versa)

Writing "target": true or "strict": "yes" gives an option a value of the wrong JSON type, which tsc rejects.

A merge or templating step injected a wrong-typed value

A generated or extended tsconfig substituted a value of the wrong type into a valid option key.

How to fix it

Give the option the type it expects

  1. Read the option name and the expected type in the error.
  2. Replace the value with one of the correct JSON type.
  3. Re-run tsc to confirm the config parses.
tsconfig.json
{
  "compilerOptions": {
    "target": "ES2022",
    "strict": true
  }
}

Validate generated tsconfig values

When a build step writes tsconfig, ensure it emits booleans and strings with the correct JSON types rather than quoting everything.

How to prevent it

  • Use editor schema validation for tsconfig.json.
  • Keep booleans unquoted and string enums quoted exactly.
  • Review generated or extended tsconfig output before committing.

Frequently asked questions

What causes "TS5024 "requires a value of type""?
Writing "target": true or "strict": "yes" gives an option a value of the wrong JSON type, which tsc rejects.
How do I fix TS5024 "requires a value of type"?
Give the option the type it expects

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card