paulirish / devtools-timeline-model

Unsupported
Other
173 stars 35 forks source link

Error "Cannot read property 'children' of undefined" #16

Closed jpvincent closed 7 years ago

jpvincent commented 8 years ago

Hi

I encoutered a JS error when analysing this file : TimelineRawData-20161030T091130.json.zip recorded with Chrome 54 on mac OSX 64 bit, with only JS profile activated and 2X CPU slowdown. It was run using Node 6.3.0

The error :

chrome-devtools-frontend/front_end/sdk/CPUProfileDataModel.js:61
            return node.children.reduce((acc, node) => acc + computeHitCountForSubtree(node), node.hitCount);
                       ^
TypeError: Cannot read property 'children' of undefined
    at computeHitCountForSubtree (chrome-devtools-frontend/front_end/sdk/CPUProfileDataModel.js:61:24)
    at Object.WebInspector.CPUProfileDataModel._translateProfileTree (chrome-devtools-frontend/front_end/sdk/CPUProfileDataModel.js:71:30)
    at Object.WebInspector.CPUProfileDataModel (chrome-devtools-frontend/front_end/sdk/CPUProfileDataModel.js:38:29)
    at Object.WebInspector.TimelineModel._processThreadEvents (chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js:737:42)
    at Object.WebInspector.TimelineModel.setEvents (chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js:504:22)
    at SandboxedModel.init (evalmachine.<anonymous>:74:25)
    at new ModelAPI (/Users/jpv/Insync/Société/Clients/lexpress.fr/stat-cpu-domain/node_modules/devtools-timeline-model/index.js:29:18)
    at Object.<anonymous> (/Users/jpv/Insync/Société/Clients/lexpress.fr/stat-cpu-domain/cpu-abuser.js:28:15)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)

Thanks

hrgui commented 7 years ago

Got the same issue as well - with different environment variables: Node 7.0.0, JS Profile activated only.

paulirish commented 7 years ago

Thanks. master branch should resolve this problem. Need to get it shipped.

jpvincent commented 7 years ago

Hi, fine The version number is still 1.1.6 on NPM, shall we wait a bit more ?

jpvincent commented 7 years ago

The master branch definitely resolves the problem, thanks for that ! However nothing has been published on npm, I had to switch my package.json dependancies from 1.1.6 to a direct inclusion of the git master branch … I'm not very confortable with that, we would appreciate you to publish a new version on npm :)

paulirish commented 7 years ago

Will do!

paulirish commented 7 years ago

version 1.2.2 is out. :)

jpvincent commented 7 years ago

great, thanks !