Open ochikov opened 5 years ago
We are unable to provide assistance without a reproduction repository.
@coreyfarrell This is the repository: https://github.com/ochikov/nyc-report-bug
I already have coverage.json in .nyc_ouput
nyc report --reporter=html
coverage
folder.Thank you.
How did you create this coverage.json? The fnMap
objects are missing decl
keys that are produced by nyc.
I created it with a solidity coverage library: https://github.com/0xProject/0x-monorepo/tree/development/packages/sol-coverage
The output is coverage.json file.
I tried with istanbul
v. 0.4.5 and the html report is working as expected.
Please report this to the 0xProject. nyc requires additional fields that were not required by istanbul@0.4.5
. I'm leaving this ticket open as we need to publish a JSON schema file to document the required format of coverage files, but any actual fix to your issue would come from the 0xProject correctly imitating the current coverage format produced by NYC.
Do you guys have update on this issue ?
i still have the same issue guys
I encountered the same issue, and I got it fixed by deleting the Coverage directory and running the nyc command again.
I get this same error often, but like two out of three times that I run nyc. Every time I run the coverage reporter, I remove .nyc_output and coverage directories. My stack trace is slightly different:
Cannot read property 'start' of undefined
TypeError: Cannot read property 'start' of undefined
at /.../node_modules/istanbul-reports/lib/html/annotator.js:53:31
at Array.forEach ()
at annotateStatements (/.../node_modules/istanbul-reports/lib/html/annotator.js:49:33)
at Object.annotateSourceCode (/.../node_modules/istanbul-reports/lib/html/annotator.js:239:9)
at HtmlReport.onDetail (/.../node_modules/istanbul-reports/lib/html/index.js:265:27)
at Visitor. [as onDetail] (/.../node_modules/istanbul-lib-report/lib/tree.js:34:30)
at ReportNode.Node.visit (/.../node_modules/istanbul-lib-report/lib/tree.js:114:17)
at /.../node_modules/istanbul-lib-report/lib/tree.js:118:15
at Array.forEach ()
at ReportNode.Node.visit (/.../node_modules/istanbul-lib-report/lib/tree.js:117:24)
This is when I generate coverage for a TypeScript codebase using nyc. I can reliably fix this error by setting all
to false in my .nycrc
, but I'd rather have that set to true because the reported coverage percentage is slightly more correct.
I have checked the coverage.json files generated by our codebase and the decl
fields are not missing.
@coreyfarrell should I create a new issue for this, or is it the same as this one?
@jaapz you are experiencing a different issue. Run npm i -D nyc@next
to upgrade to the pre-release version which fixes this issue with all
. If you need further assistance please open a new ticket with all required information.
Had the issue with the all
property as well. Just followed the recommandations from @coreyfarrell and it totally worked. Installing the next
version somehow fixed my issue.
Hello everybody, When generating an html coverage report with
nyc report --reporter=html
I am getting the html files in a folder, but trying to open a specific file, the following error is occured:The text table report works and shows results, but the HTML is broken.