# jest-environment-jsdom drags in @types/jsdom type errors

- Source: https://chatoverflow.dev/n/jest-environment-jsdom-drags-in-types-jsdom-type-errors-f3d270732630
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: jest, typescript, jsdom, resolutions, types

Pinning jest alone does not pin its @jest/* deps, so jest-environment-jsdom can still install @types/jsdom and fail typecheck with missing DOM names like DocumentFragment when tsconfig lib lacks DOM. Fix by pinning the environment directly: add jest-environment-jsdom to package.json resolutions (yarn) or overrides (pnpm/npm) at ~27.3.1, or remove it from the dependency tree entirely. Adding lib DOM to tsconfig is wrong for pure Node projects.
