Closed jsdevel closed 9 years ago
I'm getting the same error - it's broken starting 0.2.7.
Same error.
I also meet the same error
The problem is that browserify transform Istanbul takes care the coverage report... setting karma preprocessors for coverage has no effect on that.
So locking the dependency for karma-coverage
to 0.2.6
solved the issue for me after clearing node_modules
and npm install
ing.
Same here. Thanks @jsdevel !!! Finally got coverage working with karma and browserify!
I just want to mention that I'm running karma on Linux (Ubuntu 14.04). I'm trying to get all of this to work on windows, but karma-browserify /browserify is giving me errors about finding my modules..
+1 to this issue. @jsdevel 's solution worked for me.
+1 downgrading to 0.2.6 worked like @jsdevel described
+1 for this issue @jsdevel downgrade fix worked for me as well
+1 downgrading to 0.2.6 also worked here
+1 downgrading
Also ran into this issue. Downgrading worked.
For me the same, downgrading to 0.2.6 worked
+1 downgrading to 0.2.6, but any idea of when we will be able to upgrade and still have working coverage with browserify?
+1, downgrading worked.
+1 here, downgraded to 0.2.6.
Please investigate!
+1
+1
after suggested fix (#124):
ERROR [coverage]: [TypeError: Cannot set property 'covered' of undefined] TypeError: Cannot set property 'covered' of undefined at /node_modules/karma-coverage/node_modules/istanbul/lib/report/html.js:174:66 at Array.forEach (native) at annotateLines (/node_modules/karma-coverage/node_modules/istanbul/lib/report/html.js:172:28) at HtmlReport.Report.mix.writeDetailPage (/node_modules/karma-coverage/node_modules/istanbul/lib/report/html.js:406:9) at /node_modules/karma-coverage/node_modules/istanbul/lib/report/html.js:472:26 at SyncFileWriter.extend.writeFile (/node_modules/karma-coverage/node_modules/istanbul/lib/util/file-writer.js:57:9) at FileWriter.extend.writeFile (/node_modules/karma-coverage/node_modules/istanbul/lib/util/file-writer.js:147:23) at /node_modules/karma-coverage/node_modules/istanbul/lib/report/html.js:471:24 at Array.forEach (native) at HtmlReport.Report.mix.writeFiles (/node_modules/karma-coverage/node_modules/istanbul/lib/report/html.js:465:23)
@akoval See my issue: https://github.com/karma-runner/karma-coverage/issues/122#issuecomment-110399483
Should be fixed in 0.4.0
Hi @Dignifiedquire ,
After upgraded the component to 0.4.0
, I got the error
ERROR [coverage]: [TypeError: Cannot set property 'covered' of undefined]
Tried with 0.3.1
, I got the error
ERROR [coverage]: [TypeError: Cannot call method 'split' of undefined]
I just got the issue when using the transform babelify
for browserify
Is there anyone has resolved the issue yet? :((
I've just checked and realized that the component still be 0.3.1
. I still got the error
ERROR [coverage]: [TypeError: Cannot set property 'covered' of undefined]
I have also checked the release of the component and cannot find out the version 0.4.0
. The latest version now is 0.3.0
.
Are you sure you are running against the official npm registry, I get this:
❯ npm view karma-coverage@latest version
0.4.2
as well as https://www.npmjs.com/package/karma-coverage which shows the latest version being 0.4.2
Yes, sorry for my mistake. I did it. However, the issue still be there.
I tried to do with logLevel: config.LOG_DISABLE
in karma.conf.js file. The workaround works for me. But I'm not sure this is a good way.
Could you file a new issue please, and post the full log with logLevel: config.LOG_DEBUG
please?
Chrome 43.0.2357 (Mac OS X 10.10.2): Executed 313 of 324 (skipped 11) SUCCESS (0.465 secs / 0.303 secs)
ERROR [coverage]: [TypeError: Cannot read property 'text' of undefined] TypeError: Cannot read property 'text' of undefined at removed/node_modules/istanbul/lib/report/html.js:283:53 at Array.forEach (native) at annotateBranches (removed/node_modules/istanbul/lib/report/html.js:250:30) at HtmlReport.Report.mix.writeDetailPage (removed/node_modules/istanbul/lib/report/html.js:421:9) at removed/node_modules/istanbul/lib/report/html.js:484:26 at SyncFileWriter.extend.writeFile (removed/node_modules/istanbul/lib/util/file-writer.js:57:9) at FileWriter.extend.writeFile (removed/node_modules/istanbul/lib/util/file-writer.js:147:23) at removed/node_modules/istanbul/lib/report/html.js:483:24 at Array.forEach (native) at HtmlReport.Report.mix.writeFiles (removed/node_modules/istanbul/lib/report/html.js:477:23) at removed/node_modules/istanbul/lib/report/html.js:479:22 at Array.forEach (native) at HtmlReport.Report.mix.writeFiles (removed/node_modules/istanbul/lib/report/html.js:477:23) at HtmlReport.Report.mix.writeReport (removed/node_modules/istanbul/lib/report/html.js:561:14) at writeReport (removed/node_modules/karma-coverage/lib/reporter.js:56:16) at removed/node_modules/karma-coverage/lib/reporter.js:153:13 at removed/node_modules/karma/lib/helper.js:80:7 at Object.oncomplete (fs.js:108:15)
hey @Tin-Nguyen this really does sounds like a new issue. Could you raise a separate issue which will also mean everyone on this list wont get emailed?
OK @peter-mouland , I have posted 1 new issue at https://github.com/karma-runner/karma-coverage/issues/167
Hi,
I can see this has been closed as fixed but the issue still seems to exist.
28 07 2015 15:19:13.438:ERROR [coverage]: [TypeError: Cannot read property 'split' of undefined]
TypeError: Cannot read property 'split' of undefined
at HtmlReport.Report.mix.writeDetailPage (E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\reort\html.js:407:30)
at E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\report\html.js:484:26
at SyncFileWriter.extend.writeFile (E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\util\fil-writer.js:57:9)
at FileWriter.extend.writeFile (E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\util\file-writer.js:147:23)
at E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\report\html.js:483:24
at Array.forEach (native)
at HtmlReport.Report.mix.writeFiles (E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\report\tml.js:477:23)
at E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\report\html.js:479:22
at Array.forEach (native)
at HtmlReport.Report.mix.writeFiles (E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\report\tml.js:477:23)
at HtmlReport.Report.mix.writeReport (E:\Source\PROJECT\node_modules\karma-coverage\node_modules\istanbul\lib\reporthtml.js:561:14)
at writeReport (E:\Source\PROJECT\node_modules\karma-coverage\lib\reporter.js:62:16)
at E:\Source\PROJECT\node_modules\karma-coverage\lib\reporter.js:286:11
at FSReqWrap.oncomplete (fs.js:95:15)
These are my devDependencies:
"devDependencies": {
"babelify": "^6.1.2",
"browserify": "^10.2.4",
"browserify-istanbul": "^0.2.1",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-cached": "^1.1.0",
"gulp-cssmin": "^0.1.7",
"gulp-if": "^1.2.5",
"gulp-less": "^3.0.3",
"gulp-notify": "^2.2.0",
"gulp-sourcemaps": "^1.5.2",
"gulp-streamify": "0.0.5",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6",
"jasmine-core": "^2.3.4",
"karma": "^0.13.2",
"karma-browserify": "^4.2.1",
"karma-coverage": "^0.4.2",
"karma-jasmine": "^0.3.6",
"karma-mocha-reporter": "^1.0.2",
"karma-phantomjs-launcher": "^0.2.0",
"karma-phantomjs-shim": "^1.0.0",
"karma-teamcity-reporter": "^0.2.0",
"phantomjs": "^1.9.17",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.2.3"
},
And this is my config:
module.exports = function(config) {
config.set({
browsers: [ 'PhantomJS' ],
files: [
//'src/**/!(main).js',
'src/dependencies.js',
'test/**/*.tests.js'
],
frameworks: [ 'jasmine', 'browserify', 'phantomjs-shim' ],
logLevel: config.LOG_INFO, //config.LOG_DEBUG
preprocessors: {
'src/**/*.js': [ 'browserify', 'coverage' ],
'test/**/*.tests.js': [ 'browserify' ]
},
// browserify configuration
browserify: {
debug: true,
transform: [
['babelify', { sourceMaps: false, stage: 3 }],
'browserify-istanbul'
]
},
coverageReporter: {
reporters:[
{type: 'html', dir:'coverage/'},
//{type: 'teamcity'},
{type: 'text'},
{type: 'text-summary'}
],
}
});
};
I'm on Windows in case that's relevant... Locking the dependency for karma-coverage to 0.2.6 did not work for me unfortunately.
I found this issue: https://github.com/deepsweet/istanbul-instrumenter-loader/issues/32#issuecomment-249400313
Pinning to "instanbul-instrumenter-loader" : "0.2.0" fixed the issue for me.
I'm getting this error lately. Here is the full stack trace:
Here are my dependencies:
I've tried using the latest version of istanbul but that doesn't help any. Is there any more info I can provode to help troubleshoot this?
Here's my
karma.conf.js
file: