Common causes
- Passing a primitive type (string, number) where the generic requires an object shape
- The type is missing properties required by the constraint interface
- Using a union type as a type argument when the constraint requires a single compatible type
- A generic constraint changed in a library update and your type argument no longer satisfies it
How to fix it
- Make your type satisfy the constraint by adding the required properties
- Extend the required interface: interface MyType extends RequiredConstraint { ... }
- Check what the constraint requires: hover over the generic parameter in your editor
- Reconsider whether you're using the right type argument — you may need a different type
Example
function getProperty<T extends object, K extends keyof T>(obj: T, key: K) { return obj[key]; }
getProperty('not an object', 'length');
// error TS2344: Type 'string' does not satisfy the constraint 'object'.Passing a string where T extends object — strings don't satisfy the object constraint
Browse more errors
The Developer Hub covers 150+ errors across Git, npm, Node.js, Python, TypeScript, and Docker — with plain-English explanations and fix steps.
