• Error
  • Reported by the type checker

TS2741

Property '{0}' is missing in type '{1}' but required in type '{2}'.

An object lacks one required property of the target type. Add the property, or make it optional in the type.

What it means

The value is assigned to a type that requires a property it doesn't have. For several missing properties the checker uses TS2739 instead.

Example

index.ts
interface User { id: number; name: string }
const u: User = { id: 1 };
export {};
ts-r-check -p tsconfig.json --pretty false ts-r output
index.ts(2,7): error TS2741: Property 'name' is missing in type '{ id: number; }' but required in type 'User'.

Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.

How to fix

  • Add the property to the value.
  • Mark it optional in the type (name?: string) if it can be absent.