gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 786 forks source link

Error when trying to generate html reports. #702

Open tommrr opened 8 years ago

tommrr commented 8 years ago

I am trying to generate the html reports for my es6 code and receive the following error.

Cannot read property 'start' of undefined TypeError: Cannot read property 'start' of undefined at /Users/rosiet01/Documents/Subtitling/XMLParser/node_modules/nyc/node_modules/istanbul-reports/lib/html/annotator.js:50:28 at Array.forEach (native) at annotateStatements (/Users/rosiet01/Documents/Subtitling/XMLParser/node_modules/nyc/node_modules/istanbul-reports/lib/html/annotator.js:46:33) at Object.annotateSourceCode (/Users/rosiet01/Documents/Subtitling/XMLParser/node_modules/nyc/node_modules/istanbul-reports/lib/html/annotator.js:193:9) at HtmlReport.onDetail (/Users/rosiet01/Documents/Subtitling/XMLParser/node_modules/nyc/node_modules/istanbul-reports/lib/html/index.js:217:39) at Visitor.(anonymous function) [as onDetail] (/Users/rosiet01/Documents/Subtitling/XMLParser/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:34:30) at ReportNode.Node.visit (/Users/rosiet01/Documents/Subtitling/XMLParser/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:123:17) at /Users/rosiet01/Documents/Subtitling/XMLParser/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:116:23 at Array.forEach (native) at visitChildren (/Users/rosiet01/Documents/Subtitling/XMLParser/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:115:32)

GeeWee commented 7 years ago

+1 - I get this when transpiling typescript and piping it to istanbul

moribellamy commented 4 years ago

same issue. you can reproduce it with my open source app at this commit: https://github.com/moribellamy/graytabby/tree/bfd1a7bf5426e6169d95cbeed4266a5ed26bd462

npm run test:coverage gives good enough lcov data, but the HTML report has the error @tomrosier gives above