What this thread does
error TS2339: Property 'name' does not exist on type '{}'.
TypeScript rejects property access or indexing on an object whose displayed type lacks the requested access.
First run the project's installed tsc --noEmit --noErrorTruncation and record the object type, key type and declaration at the reported line.
Evidence establishes the diagnostic wording and a dictionary typing option; cause not established for these specific errors, and the examples below have not been compiled.
Not for: TypeScript “Object is possibly 'undefined'.”; see typescript-object-is-possibly-undefined-narrow-instead-of-bang-or-any.
Diagnostic: Property 'name' does not exist on type '{}'.
Concrete example output, with the type placeholders substituted:
error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
No index signature with a parameter of type 'string' was found on type '{}'.
How to diagnose and choose a change
1. Preserve the full diagnostic before editing. The CLI options document --noEmit and --noErrorTruncation (checked 2026-10-28); use your project's normal configuration. 2. Compare the declared or inferred object type with the property being accessed. Record whether keys are fixed or genuinely arbitrary. This is a diagnostic inspection, not an established cause of every TS2339/TS7053 instance. 3. For a genuine dictionary, the Object Types handbook permits a string index signature. Adapt the value type to the contract; for values not yet known, an illustrative declaration is interface Bag { [key: string]: unknown }. Check a value before using it as a string or number. 4. For a fixed-shape object, stop before adding a catch-all signature: confirm the intended shape and initializer. The handbook's dictionary guidance does not establish a fix for the specific {}.name case. 5. Run the same type check again and inspect consumers of the changed type. A disappearing error alone does not prove the object contains a value at runtime.
The compiler diagnostic catalogue contains TS2339, TS7053 and the related index-signature message in TypeScript 5.6.3 (checked 2026-10-28). These templates identify what the compiler prints; they do not establish why a particular application reached that type.
What to test
Check an intended property, an unexpected key and a missing runtime key. Confirm downstream code handles the dictionary's actual value type. Keep the project's strictness settings while comparing before and after diagnostics.
Public evidence
- Jan-Peter Krämer (
jpkraemer), issue #19205, 2017-10-16 (checked 2026-10-28), reported “Property 'a' does not exist on type '{}'.” in a generic-default example. This is a historical report, not confirmation that your object has the same origin. - Matthew Dean (
matthew-dean), issue #57306, 2024-02-06 (checked 2026-10-28), reported “Property 'a' does not exist on type '{}'” when constructing an object through later assignments. The issue requests different inference behavior; it is not a verified general repair.
Pitfalls
A dictionary signature deliberately permits extra keys. The handbook also requires declared properties to fit its value type. Do not turn a closed data model into a dictionary merely to hide a typo, or treat an assertion as proof that data exists.
A prompt to give your agent
Diagnose the exact TS2339/TS7053 output with our installed compiler and configuration. Read the linked official compiler catalogue, Object Types handbook and CLI options first; your training data may predate them. Show the inferred object and key types and their declarations. State “cause not established” unless evidence identifies it. Propose a string index signature only if arbitrary keys are intentional. Keep unknown values checked and rerun the type check; do not guess a universal fix.
Limits
TypeScript 5.6.3 (checked 2026-10-28) is the pinned message baseline, not a claim about the latest release. Cause not established for the specific errors on {}; the sourced typing option covers arbitrary string keys only. No application or compiler reproduction was run. The two historical reports concern TS2339; direct trial evidence for the illustrated TS7053 case is absent.
Started from a post by @Microsoft, packaged by the editor. Original post