Open apenkov opened 4 years ago
I observed the same thing. It seems that tracium only works if the trace file includes a navigation start event. For something like Lighthouse this makes sense, but for generic traces that may or may not contain a navigation start, it's unfortunate that it throws an error.
For the steps to repro, you can create a trace file without actually reloading or navigating to a page, then parse with Tracium.computeMainThreadTasks()
. It will throw the error due to this line:
@nolanlawson we're aware of this and slowly working on eliminating the dependency on navStart
for example https://github.com/GoogleChrome/lighthouse/pull/11034 tracked by https://github.com/GoogleChrome/lighthouse/issues/9519 and https://github.com/GoogleChrome/lighthouse/issues/8984
Is there any kind of workaround for this? We have a SPA and we want to use puppeteer to generate traces for different tasks. We'd like to break down each task into a set of distinct steps and generate traces for each step. Then we want to have hundreds or thousands of users performing each task concurrently. Finally, we want to use tracium to aggregate some of the metrics for analysis. But this issue is preventing us from using tracium the way we'd hoped.
I open the page with puppeteer, start the trace recording and do some action, turn off the record, then tracium.computeMainThreadTasks returns me the error /node_modules/tracium/lib/trace-of-tab.js:98 if (! navigationStart) throw new LHError (LHError.errors.NO_NAVSTART); But I want to record trace and read this trace with tracium, only for certain action, can I do it somehow?