Error AtlasError Documentation and Resolution

Argument is not assignable to the parameter type

Argument of type '{0}' is not assignable to parameter of type '{1}'.

TypeScript found a function call where the provided argument type does not match the parameter type.

TS2345build
Argument of type '{0}' is not assignable to parameter of type '{1}'.
  • A function is being called with a value whose type does not match the declared parameter type.
  • A union value is passed to a function before TypeScript can narrow it to the required member type.
  • A third-party type definition or generic constraint is stricter than the value being passed.
  1. Pass a value that matches the declared parameter type.
  2. Add narrowing logic before the function call so TypeScript can prove the argument is valid.
  3. Review the function signature, generic constraints, or external type definitions if the current typing is too restrictive.
TypeScript Handbook: Narrowing
TS2345 Argument of type is not assignable to parameter of type: causes and fixes | Error Atlas