c8: Cannot read property 'loc' of undefined

  • Version:V12.14.0
  • Platform:Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

Hello, updating C8 to V7 i get the following error (in place of report)

TypeError: Cannot read property 'loc' of undefined
    at ~/my-project/node_modules/istanbul-reports/lib/lcovonly/index.js:53:35
    at Array.forEach (<anonymous>)
    at LcovOnlyReport.onDetail (~/my-project/node_modules/istanbul-reports/lib/lcovonly/index.js:51:34)
    at LcovReport.<computed> [as onDetail] (~/my-project/node_modules/istanbul-reports/lib/lcov/index.js:25:23)
    at Visitor.value (~/my-project/node_modules/istanbul-lib-report/lib/tree.js:38:38)
    at ReportNode.visit (~/my-project/node_modules/istanbul-lib-report/lib/tree.js:88:21)
    at ~/my-project/node_modules/istanbul-lib-report/lib/tree.js:92:19
    at Array.forEach (<anonymous>)
    at ReportNode.visit (~/my-project/node_modules/istanbul-lib-report/lib/tree.js:91:28)
    at ~/my-project/node_modules/istanbul-lib-report/lib/tree.js:92:19

the command i run npx c8 ava --fail-fast --verbose ./build/test/file.spec.js

I use the following .nycrc.json

{
    "extension": [".ts"],
    "include": ["build/server"],
    "exclude": [],
    "reporter": ["lcov", "text", "html", "text-summary"],
    "cache": false,
    "sourceMap": true,
    "instrument": true,
    "all": true,
    "check-coverage": true,
    "branches": 80,
    "lines": 80,
    "functions": 80,
    "statements": 80,
    "watermarks": {
        "lines": [80, 95],
        "functions": [80, 95],
        "branches": [80, 95],
        "statements": [80, 95]
    }
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (3 by maintainers)

Most upvoted comments

Please try removing "all": true, let us know if you still get the error.

I think this is still a valid bug, it shows that all: true (a new feature to c8) is failing for you. I’m sure @bcoe would still appreciate seeing a reproduction of the issue so it can be investigated further.