karma-coverage icon indicating copy to clipboard operation
karma-coverage copied to clipboard

TypeError: Cannot read property 'start' of undefined

Open adjavaherian opened this issue 9 years ago • 4 comments

Trying to figure out what this is all about. Not sure what exactly is being pushed into object-utils. Any ideas? FWIW I'm using this instrumenter https://github.com/deepsweet/istanbul-instrumenter-loader

15 12 2015 16:47:52.674:ERROR [coverage]: [TypeError: Cannot read property 'start' of undefined]
TypeError: Cannot read property 'start' of undefined
at /home/adjavaherian/Desktop/web-off-master/node_modules/istanbul/lib/object-utils.js:59:44
at Array.forEach (native)
at Object.addDerivedInfoForFile (/home/adjavaherian/Desktop/web-off-master/node_modules/istanbul/lib/object-utils.js:58:37)
at Object.Collector.fileCoverageFor (/home/adjavaherian/Desktop/web-off-master/node_modules/istanbul/lib/collector.js:94:15)
at /home/adjavaherian/Desktop/web-off-master/node_modules/istanbul/lib/report/text.js:210:27
at Array.forEach (native)
at TextReport.Report.mix.writeReport (/home/adjavaherian/Desktop/web-off-master/node_modules/istanbul/lib/report/text.js:208:27)
at writeReport (/home/adjavaherian/Desktop/web-off-master/node_modules/karma-coverage/lib/reporter.js:62:16)
at /home/adjavaherian/Desktop/web-off-master/node_modules/karma-coverage/lib/reporter.js:282:11
at Array.forEach (native)
at forEach (/home/adjavaherian/Desktop/web-off-master/node_modules/karma/lib/browser_collection.js:93:21)
at /home/adjavaherian/Desktop/web-off-master/node_modules/karma-coverage/lib/reporter.js:241:16
at Array.forEach (native)
at onRunComplete (/home/adjavaherian/Desktop/web-off-master/node_modules/karma-coverage/lib/reporter.js:240:15)
at null.<anonymous> (/home/adjavaherian/Desktop/web-off-master/node_modules/karma/lib/events.js:13:22)
at emitTwo (events.js:92:20)

adjavaherian avatar Dec 16 '15 01:12 adjavaherian

Have the same problem!

rogerwaldvogel avatar Dec 24 '15 06:12 rogerwaldvogel

See the answer here: https://github.com/deepsweet/istanbul-instrumenter-loader/issues/16 it's a bug involving the loader termination.

adjavaherian avatar Dec 24 '15 07:12 adjavaherian

Have the same problem, could you explain a bit more about the solution? Thank you!

alexpatow avatar Jan 21 '16 23:01 alexpatow

I have no idea, but removing

function feed(state = initialState, action) { }

and replacing with: function feed(state, action) { if (!state) state = initialState; }

works for me. I have no idea why, but it might have something to do with babel and default parameters...

stianlp avatar Nov 14 '16 14:11 stianlp