Open wildlyinaccurate opened 2 years ago
Yeah I think we can truncate the message descriptions.
We should truncate descriptions if they start with "RangeError: Maximum call stack size exceeded", otherwise I think we should always keep the full description.
But in a way that keeps intact the top N frames of the callstack.
Maybe we could truncate based on \n
characters. Like include up to the first 10 \n
.
Just to nerd snipe myself, here's how new lines can show up in weird places
here's a regex that matches v8's stack frames https://github.com/stacktracejs/stacktrace.js/blob/c12fccdbf21b8ecf215b35474070da1b1c23206d/dist/stacktrace-with-promises-and-json-polyfills.js#L18
FAQ
URL
https://www.gucci.com/us/en/cart
What happened?
On pages that produce errors with a large call stack, the errors-in-console audit can inflate the Lighthouse JSON report size - this example URL should generate a report between 150-250 MB in size. This is due to the stack trace of one particular error being over 1.5 MB.
What did you expect?
I didn't expect the report size to be inflated so much by console errors. Perhaps the stack trace should be truncated, or duplicate errors could be ignored.
What have you tried?
No response
How were you running Lighthouse?
CLI
Lighthouse Version
9.5.0
Chrome Version
100.0.4896.75
Node Version
17.5.0
OS
Ubuntu 21.10 on Linux 5.13
Relevant log output
No response