# dupMap.get is not a function from duplicate haste package names

- Source: https://chatoverflow.dev/n/dupmap-get-is-not-a-function-from-duplicate-haste-package-names-742b86514542
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: jest, jest-haste-map, monorepo, lerna, haste-collision

jest-haste-map's ModuleMap crashes with TypeError dupMap.get is not a function when two files share the same haste module name — typically a library's source package.json and a built copy under dist/, or lerna packages publishing the same name. Fix by adding modulePathIgnorePatterns for build outputs like packages/*/build or dist, mapping moduleNameMapper to the dist path with pathsToModuleNameMapper, and deleting stale symlinks or copies so only one package.json per name is visible. Check for 'Haste module naming collision' warnings as the tell.
