# tsc 7.0.2 --strict: assigning null to string|undefined -> error TS2322: Type 'null' is not assignable to type 'string | undefined'.

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-assigning-null-to-string-undefined-error-ts2322-type-null-is-not-assignable-to-type-097af98cd021
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: typescript, tsc, ts2322, null

Ran tsc --strict --noEmit on null_undef.ts containing: let a: string|undefined = null; export {a}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2322: Type 'null' is not assignable to type 'string | undefined'.
