Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'text' of undefined #167

Open
Tin-Nguyen opened this issue Jul 13, 2015 · 10 comments
Open

TypeError: Cannot read property 'text' of undefined #167

Tin-Nguyen opened this issue Jul 13, 2015 · 10 comments

Comments

@Tin-Nguyen
Copy link

I'm facing 1 issue on my Unit Test. It happens when I tried to add babelify into browerify's transform to convert ES6 in my implement code.

browserify: {
      transform: ['babelify', 'reactify', 'istanbulify'],
      extensions: ['.js', '.jsx'],
      debug: true,
      bundleDelay: 1000,  // WAR for karma-browserify race condition
},

I'm using:

  • Istanbul: 0.3.17
  • karma-coverage: 0.4.2
  • babelify: 6.1.2

Chrome 43.0.2357 (Mac OS X 10.10.2): Executed 313 of 324 (skipped 11) SUCCESS (0.515 secs / 0.313 secs)

ERROR [coverage]: [TypeError: Cannot read property 'text' of undefined]
TypeError: Cannot read property 'text' of undefined
at /node_modules/istanbul/lib/report/html.js:283:53
at Array.forEach (native)
at annotateBranches (/node_modules/istanbul/lib/report/html.js:250:30)
at HtmlReport.Report.mix.writeDetailPage (/node_modules/istanbul/lib/report/html.js:421:9)
at /node_modules/istanbul/lib/report/html.js:484:26
at SyncFileWriter.extend.writeFile (/node_modules/istanbul/lib/util/file-writer.js:57:9)
at FileWriter.extend.writeFile (/node_modules/istanbul/lib/util/file-writer.js:147:23)
at /node_modules/istanbul/lib/report/html.js:483:24
at Array.forEach (native)
at HtmlReport.Report.mix.writeFiles (/node_modules/istanbul/lib/report/html.js:477:23)

@dignifiedquire
Copy link
Member

Could you either post a link to the code or supply a minimal example reproducing this please?

@Tin-Nguyen
Copy link
Author

Hi @dignifiedquire ,

I think I've provided all things on my post. Because the Unit Test still works well, and the report has been created/updated successfully. However, we got the error in end of progress.

And I just get the issue when I add babelify transform into the config. Have you checked with babelify yet?

Please let me know if you need to get what information from my case. I will investigate deeper on this issue today.

Regards,
Tin Nguyen

@Tin-Nguyen
Copy link
Author

Hi @dignifiedquire , is there any updates on this? the issue still be my tests :((

@dignifiedquire
Copy link
Member

Sorry I haven't gotten to it yet, will try to take a look later today

@jljorgenson18
Copy link

+1

@Tin-Nguyen
Copy link
Author

Hi @dignifiedquire ,

I removed babelify, the report works fine. I really don't know the root cause. Could you help to check?

@vectart
Copy link

vectart commented Aug 10, 2015

I switched to cheap-module-source-map and the issue is gone. Seems like incorrect sourcemap causes the failure while branch annotation.

@SpenceDiNicolantonio
Copy link

This appears to be an issue with Istanbul and source maps. See #157 (comment).

@dignifiedquire
Copy link
Member

Yes this seems to be the same issue as #157

SteveVanOpstal added a commit to SteveVanOpstal/LegendBuilder that referenced this issue Feb 7, 2017
SteveVanOpstal pushed a commit to SteveVanOpstal/LegendBuilder that referenced this issue Feb 7, 2017
* chore(package): update dependencies

* chore(travis): whitelist greenkeeper branches 

* docs(readme): add Greenkeeper badge 

* docs(readme): move Greenkeeper badge

* build(webpack): add entry file

* chore(package): downgrade instanbul-instrumenter-loader

karma-runner/karma-coverage#167


https://greenkeeper.io/
@icfantv
Copy link

icfantv commented Jan 9, 2018

We had this error and I spent yesterday morning fixing. Here's a write-up of what worked for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants