template.ts:78 casts templates.json to OptionInterface[]. The JSON doesn't actually match the type (treeList and modifiers are often absent; Modifiers.expression is usually a string or missing, not the declared Expression object).
On the full production templates.json tsc skips this check (type too complex) and passes. On a smaller regenerated file the check runs and npm run build fails at template.ts:78 — so any PR that shrinks templates.json breaks the build with an unrelated-looking error.
Fix
Make the types match the data:
template.ts: treeList?, modifiers?, choiceModifiers?: { [key: string]: Modifiers | undefined }
modifier-helpers.ts:16: expression?: Expression | string
- fix the fallout at
interpreter.ts:810 (treeList guard) and ~853 (second Modifiers type still requires expression)
template.ts:78caststemplates.jsontoOptionInterface[]. The JSON doesn't actually match the type (treeListandmodifiersare often absent;Modifiers.expressionis usually a string or missing, not the declaredExpressionobject).On the full production
templates.jsontscskips this check (type too complex) and passes. On a smaller regenerated file the check runs andnpm run buildfails attemplate.ts:78— so any PR that shrinkstemplates.jsonbreaks the build with an unrelated-looking error.Fix
Make the types match the data:
template.ts:treeList?,modifiers?,choiceModifiers?: { [key: string]: Modifiers | undefined }modifier-helpers.ts:16:expression?: Expression | stringinterpreter.ts:810(treeList guard) and~853(secondModifierstype still requiresexpression)