paulirish / devtools-timeline-model

Unsupported

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RangeError: Maximum call stack size exceeded due to console.assert patching

hrgui opened this issue · comments

Error:

RangeError: Maximum call stack size exceeded
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:33:26)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)
at Console.console.assert [as __originalAssert] (chrome-devtools-frontend/front_end/platform/utilities.js:36:11)

Sample script

let model = new DevtoolsTimelineModel(page._tracingEntries);
let timelineModel = model.timelineModel();

Where did the data come from?
Chrome RDP

Params passed in to Chrome RDP

{
"TRACE_OPTIONS": "sampling-frequency=10000",
"TRACE_CATEGORIES": ["-*", "devtools.timeline", "disabled-by-default-devtools.timeline", "disabled-by-default-devtools.timeline.frame", "toplevel", "blink.console", "disabled-by-default-devtools.timeline.stack", "disabled-by-default-devtools.screenshot", "disabled-by-default-v8.cpu_profile"]
}

I'm going to try if this change ChromeDevTools/devtools-frontend@e5855e5 fixes the problem.

Update:

TypeError: Class extends value undefined is not a function or null
        at eval (chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js:1811:70)
        at requireval (evalmachine.<anonymous>:14:3)
        at evalmachine.<anonymous>:87:1
        at ContextifyScript.Script.runInContext (vm.js:35:29)

another update:
So I tried commenting it out manually and used npm link, got this problem - seems like I know what to do now but the stack overflow problem is masking this error:

 AssertionError: Multiple sessions in trace
        at Console.assert (console.js:95:23)
        at _processMetadataEvents (chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js:285:17)
        at setEvents (chrome-devtools-frontend/front_end/timeline_model/TimelineModel.js:230:31)
        at SandboxedModel.init (evalmachine.<anonymous>:129:25)

@hrgui nice debugging. I ran into troubles with the console code and have since updated this module to include the latest devtools source which has ChromeDevTools/devtools-frontend@e5855e5

you can try the new 1.3.0, but i imagine you'll still get "Multiple sessions in trace".
Can you confirm that? also see #15

@paulirish so the reason why I had multiple sessions in trace is because i had duplicate copies of events, which triggered that assert. (this was due to my code over subscribing an event emitter and not cleaning up properly)

I will try the new 1.3.0 to ensure that the max call stack trace is not appearing anymore.

k sounds good!