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.
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
- Read the option name and the expected type in the error.
- Replace the value with one of the correct JSON type.
- Re-run tsc to confirm the config parses.
{
"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.