• Error
  • Reported by the binder

TS1117

An object literal cannot have multiple properties with the same name.

An object literal defines the same property name twice. Remove one of them or rename it.

What it means

In an object literal, a second property with the same name silently overwrites the first at runtime, which is almost always a mistake, so it's reported on the second one.

Example

index.ts
const o = { a: 1, a: 2 };
export {};
ts-r-check -p tsconfig.json --pretty false ts-r output
index.ts(1,19): error TS1117: An object literal cannot have multiple properties with the same name.

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

  • Delete the duplicate property, keeping the value you mean.
  • If both values are needed, give them different names.