Skip to content
Latchkey

tsc TS2339: Property 'x' does not exist on type 'Y' in CI

TS2339 means tsc inferred a type for the value that has no such property. The access may be valid at runtime, but the static type does not declare the member, so type-checking fails.

What this error means

tsc fails with "error TS2339: Property 'x' does not exist on type 'Y'", sometimes adding "Did you mean 'z'?" when a similar member exists.

tsc
src/user.ts:7:14 - error TS2339: Property 'fullName' does not exist on type 'User'.

7   return user.fullName;
               ~~~~~~~~

Common causes

The member is genuinely not on the declared type

A typo, a renamed field, or a property added at runtime but never in the interface produces a type that lacks the member.

The value is typed too narrowly or as a base type

tsc inferred a narrow union member or a base interface that does not include the property you expect.

How to fix it

Add the property to the type or fix the access

  1. Check the type named after "on type" to see what members it declares.
  2. Correct a typo, or add the missing field to the interface if it should exist.
  3. Re-run tsc to confirm the property is now recognized.
src/user.ts
interface User {
  id: string;
  fullName: string; // declare the field you access
}

Narrow a union before accessing member-specific properties

When the value is a union, guard for the variant that has the property before reading it.

src/user.ts
if ('fullName' in user) {
  return user.fullName;
}

How to prevent it

  • Keep interfaces in sync with the objects they describe.
  • Prefer discriminated unions with guards over loose any access.
  • Enable strict mode so missing members are caught consistently.

Frequently asked questions

What causes "TS2339 "Property does not exist on type""?
A typo, a renamed field, or a property added at runtime but never in the interface produces a type that lacks the member.
How do I fix TS2339 "Property does not exist on type"?
Add the property to the type or fix the access

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card