• Error
  • Reported by the type checker

TS2320

Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'.

An interface extends two types that declare the same property with different types. Make them agree, or redeclare the property in the interface.

What it means

When an interface extends several types, their members are combined. If two of them have a member with the same name but incompatible types, the interface can't extend both.

Example

index.ts
interface A {
  id: string;
}
interface B {
  id: number;
}

export interface C extends A, B {}
ts-r-check -p tsconfig.json --pretty false ts-r output
index.ts(8,18): error TS2320: Interface 'C' cannot simultaneously extend types 'A' and 'B'.
  Named property 'id' of types 'A' and 'B' are not identical.

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

  • Make the member's type the same in both bases.
  • Or declare the member in the extending interface with a type assignable to both.