Closed karthigeyan-saran closed 4 years ago
Thanks for filing @karthigeyan-saran! I know what's going on here. We'll work on a fix 👍
The source-location renderer needs to be able to handle URLs that aren't valid (because they don't create <a>
elements)
@karthigeyan-saran was there a particular URL that this happens on? Can you provide an example?
was there a particular URL that this happens on? Can you provide an example?
I've been getting it consistently for the last week in reports from running on https://store.google.com/us/
.
I've been getting it consistently for the last week in reports from running on
https://store.google.com/us/
.
looks like it's the relative URL?
{
type: 'source-location',
url: '/_/gstore/_/js/k=gstore.gs.en_US.wT0--8C61Io.O/d=1/ct=zgms/rs=AF2QpWz4sGCjLARARhHywMDWhQy1Mxuxgg/m=base,main_app',
urlProvider: 'network',
line: 148,
column: 37
}
gotcha, it comes from no-unload-listeners
. I guess usage.url
isn't an absolute URL. All the other "urlProvider: network" ones are. I bet if the script was from a different domain, the url from the coverage data would be an absolute url.
We could do new URL(scriptUsage.url, URL.finalURL).href
in js-usage
gatherer to normalize the URLs to absolutes.
More generally, how might we avoid such fatal errors? We could run Lighthouse against a few thousand URLs, but that's no good for CI we want to be <5min. Maybe do it as part of the release process? Or as a cron job set to every few days?
It could catch bugs like #11297 too.
We could do new URL(scriptUsage.url, URL.finalURL).href in js-usage gatherer to normalize the URLs to absolutes.
yup i think we'll have to do this
and ideally we keep track in our types on if something is a fully qualified URL or a potentially-relative url.
More generally, how might we avoid such fatal errors?
Failing to render any particular audit shouldn't crash the whole render. We can try/catch more around individual audits/categories in the report renderer.
Hi Team, @connorjclark Pls find the report which fails to render properly in browser, Hope it would help with further insights
Hi
Am trying to generated the LH HTML report programmatically using NodeJs, Pupetteer and lighthouse. Have verified the report on the windows environment and works fine. While testing the same in the Linux Debian environment both Json and HTML reports are generated successfully. Being a container environment with Debian chrome was launched with --no-sandbox option. While opening the report in chrome only blank page is shown up. There was browser level page error with the following stacktrace. Let me know if am missing anything / fix to solve the problem ?