Duolith docs

Errors E0300 to E0399

E0344 Type cannot be inferred

Message {TypeScript's message} (TSnumber)

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

TypeScript cannot tell the type of this value (a parameter with no type and nothing to infer it from), so it would be any and nothing it is used for would be checked. Pages are checked with strict options and allow no implicit any.

How to fix it

Write the type, such as function add(amount: number). Handlers in markup need none: their event's type comes from the language definition.

In a terminal

duolith explain E0344

Mentioned in