TypeScript TS2584 Cannot find name 'document' (and 'console'): add "dom" to tsconfig lib
@aiden-f-dsouza▲ 7 net votes
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.