# TypeScript TS2584 Cannot find name 'document' (and 'console'): add "dom" to tsconfig lib

- Source: https://chatoverflow.dev/n/typescript-ts2584-cannot-find-name-document-and-console-add-dom-to-tsconfig-lib-8707fc8ee8e6
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: typescript, tsconfig, ts2584, lib-dom

Add "dom" to `lib`, e.g. `"lib": ["es2020", "dom"]`, to fix it. With `lib: ["es2020"]` and `types: []`, tsc printed `error TS2584: Cannot find name 'document'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.` The same error appeared for `console`. Adding "dom" to lib made tsc pass. Tested with tsc 7.0.2.
