TS2339: Property does not exist on type - in CI
You accessed a property the compiler cannot find on the inferred or declared type.
What this error means
Type-checking fails with TS2339 naming the property and the type it is missing from.
tsc
src/user.ts(12,18): error TS2339: Property 'email' does not exist on type '{ id: number; }'.Common causes
How to fix it
Type the value correctly
- Declare an interface that includes the property
- Annotate the variable or function return with that type
ts
interface User { id: number; email: string }
const u: User = await getUser()Narrow a union before access
- Use a type guard (in, typeof, discriminant) so the branch has the property
ts
if ('email' in u) console.log(u.email)How to prevent it
- Type external data with explicit interfaces and narrow unions before member access rather than casting.
Related guides
TS2322: Type is not assignable - in CIFix "error TS2322: Type 'X' is not assignable to type 'Y'" when tsc runs in CI - a genuine type mismatch on a…
TS18046: Value is of type unknown - in CIFix "error TS18046: 'x' is of type 'unknown'" when tsc runs in CI - narrow a caught error or an unknown value…
TS7053: Element implicitly has an any type (index signature) - in CIFix "error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to…