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.

TypeError: Cannot read property 'text' of undefined

See original GitHub issue

not entirely sure if this is an issue with istanbul directly or karma-coverage, but i think it’s an istanbul thing so i created this issue with them but you may want to look into it too:

04 10 2017 09:34:48.018:ERROR [coverage]: TypeError: Cannot read property 'text' of undefined
    at project/node_modules/istanbul/lib/report/html.js:288:53
    at Array.forEach (native)
    at annotateBranches (project/node_modules/istanbul/lib/report/html.js:255:30)
    at HtmlReport.writeDetailPage (project/node_modules/istanbul/lib/report/html.js:426:9)
    at project/node_modules/istanbul/lib/report/html.js:489:26
    at SyncFileWriter.writeFile (project/node_modules/istanbul/lib/util/file-writer.js:57:9)
    at FileWriter.writeFile (project/node_modules/istanbul/lib/util/file-writer.js:147:23)
    at project/node_modules/istanbul/lib/report/html.js:488:24
    at Array.forEach (native)
    at HtmlReport.writeFiles (project/node_modules/istanbul/lib/report/html.js:482:23)
    at project/node_modules/istanbul/lib/report/html.js:484:22
    at Array.forEach (native)
    at HtmlReport.writeFiles (project/node_modules/istanbul/lib/report/html.js:482:23)
    at HtmlReport.writeReport (project/node_modules/istanbul/lib/report/html.js:566:14)
    at writeReport (project/node_modules/karma-coverage/lib/reporter.js:68:16)
    at project/node_modules/karma-coverage/lib/reporter.js:296:11

the problem is:

text = structuredText[startLine].text;

i guess it assumes structuredText[startLine] is always going to be a thing, and apparently at least once it is not a thing? I don’t know how you can reproduce it; just let me know what you need that i can provide and i’ll provide it.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
renanvalentincommented, Dec 13, 2017

I’m having a similar problem with flow and closure:

this will throw an error:

const test = (arg : string) : Function => (arg2 : string) => false;

this works fine

const test = (arg : string) : Function => {
    return (arg2 : string) => {
        return false;
    };
};

Should I open a new issue?

0reactions
ffesselercommented, Sep 2, 2018

Not a npm package, juste a reporter config.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot read property 'text' of undefined - Stack Overflow
Yep, only two places that .text is referred to-- either $("headingWiki_0 h3 span") isn't returning anything or your data return from the $....
Read more >
ERROR in : TypeError: Cannot read property 'text' of ... - GitHub
Hard to say, since the error seems deep into the typescript stack. Assuming you have a similar error stack to the one shown...
Read more >
Cannot read property 'text' of undefined | Jira
Cause and possible solutions: This can be caused by more than one thing: The Board's estimation: If you go to the board's configuration...
Read more >
JS error. Cannot read property 'text' of undefined...unsure what
The error means that quiz.getCurrentQuestion() returns undefined, so take a look at your implementation of that method. If you cannot see the ...
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError: Cannot read property of undefined ... JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible...
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