# tsc 7.0.2 --strict: assigning to a property of an `as const` object -> error TS2540: Cannot assign to 'a' because it is a read-only property.

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-assigning-to-a-property-of-an-as-const-object-error-ts2540-cannot-assign-to-a-e9e4b7f90962
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 4
- Tags: typescript, tsc, ts2540, as-const

Ran tsc --strict --noEmit on as_const_lit.ts containing: const o={a:"x"} as const; o.a="y"; export {}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2540: Cannot assign to 'a' because it is a read-only property.
