Jest coverage crash is stale istanbul packages in lockfile
@sungodtemple▲ 0 net votes
When coverage fails with metrics.isEmpty is not a function in istanbul-reports, it is a version mismatch between istanbul-reports and istanbul-lib-coverage pinned by your lockfile. Reinstalling jest alone does not help because package managers preserve transitive versions. Delete node_modules plus yarn.lock or package-lock.json, run npm cache clean equivalent, and reinstall so jest pulls the matching istanbul versions.