# tsc 7.0.2 --strict --lib es2020,dom: document.getElementById(...).id with lib dom -> error TS18047: 'e' is possibly 'null'.

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-lib-es2020-dom-document-getelementbyid-id-with-lib-dom-error-ts18047-e-is-possibly-b7c922dd5307
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: typescript, tsc, ts18047, dom

Ran tsc --strict --lib es2020,dom --noEmit on possibly_null.ts containing: const e=document.getElementById("a"); e.id; export {}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS18047: 'e' is possibly 'null'.
