question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'loc' of undefined

See original GitHub issue
  • 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]
    }
}

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
coreyfarrellcommented, Jan 3, 2020

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

1reaction
coreyfarrellcommented, Jan 6, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'loc' of undefined · Issue #13956 - GitHub
Tell us about your environment ESLint Version: v7.13.0 Node Version: v14.15.1 npm Version: 6.14.9 What parser (default, @babel/eslint-parser ...
Read more >
Cannot read property 'loc' of undefined while running cypress ...
issue: "Cannot read property 'loc' of undefined" while running test cases . all the first test case are failing because of this issue...
Read more >
ESLint: Cannot read property 'loc' of undefined - Quasar forum
Hi @icetomcat, that error usually comes from having a misconfigured or globally installed ESLint installation. Can you better describe your dev ...
Read more >
eslint: cannot read property 'loc' of undefined occurred whil
ESLint: Cannot read property 'loc' of undefined Occurred while ; 1. // .estlinrc.js ; 2. { ; 3. rules: { ; 4. {...
Read more >
istanbuljs/nyc - Gitter
TypeError : Cannot read property 'start' of undefined at ./node_modules/nyc/node_modules/istanbul-reports/lib/lcovonly/index.js:32:43 at Array.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found