One rule
Do not reach for any when TypeScript complains. Read the error, find what TypeScript expected, then fix the data, the type, or the check.
any turns off the useful part of TypeScript. It can make your demo build while leaving the crash inside.
How errors speak
Most TypeScript errors have two sides. One side says what value you gave. The other says what type was expected.
Start with the last line of the error. Then move up only if you need the file path or the exact call site.