To solve the error, explicitly type the empty array, e.g. The solution to resolve this issue correctly is to help TypeScript to infer the type. type 'string' is not assignable to type 'never' keyof for-loop: Type 'number' is not assignable to type 'never'. #10721 Classes. Object literal may only specify known properties, and 'placeholder' does not exist in . Type 'null' is not assignable to type 'string' Type 'string | undefined' is not assignable to type 'string'. Save my name, email, and website in this browser for the next time I comment. typescript - How to fix "Type 'string' is not assignable to type 'never ... Typescript is a structurally typed language, which means that a class' type and properties are defined by its structure. When you declare a variable using const, var, or let, you can optionally add a type annotation to explicitly specify the type of the variable: ts. Argument of type 'string' is not assignable to parameter of type 'never ... What is "not assignable to parameter of type never" error in typescript? Type 'null' is not assignable to type 'string' Type 'string | undefined' is not assignable to type 'string'. Incorrectly sets type to "never" · Issue #32375 - GitHub the problem is that the expression result[key] has type never, which is a type with no values.Let's see why it happens: key has type 'ONE'|'TWO'; result has type { 'ONE': 'ONE'; 'TWO': 'TWO' } hence: .