Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Avoids an excessive DOM size" audit shows NaN when it exceeds 1000 #11562

Closed
sisidovski opened this issue Oct 14, 2020 · 1 comment · Fixed by #11563
Closed

"Avoids an excessive DOM size" audit shows NaN when it exceeds 1000 #11562

sisidovski opened this issue Oct 14, 2020 · 1 comment · Fixed by #11563
Assignees

Comments

@sisidovski
Copy link

sisidovski commented Oct 14, 2020

Provide the steps to reproduce

  1. Run LH on https://www.yahoo.co.jp/ with desktop mode like this ./lighthouse-cli/index.js https://www.yahoo.co.jp/ --view --emulated-form-factor=desktop
  2. See dom-size audit in HTML report

What is the current behavior?

When the number of total DOM size proceeds 1000, the Lighthouse HTML results shows NaN in the table.

Screen Shot 2020-10-14 at 19 03 05

What is the expected behavior?

Formatted number should be appeared, which is 1,114

I think it can be fixed by removing i18n.formatNumber in the audit from here. Currently formatNumber is called twice in here and details-renderer, which is injected to HTML report.

Environment Information

  • Affected Channels: Node, DevTools etc
  • Lighthouse version: 6.4.1
  • Chrome version: 86.0.4240.75
  • Node.js version: v12.16.1
  • Operating System: MacOS

Related issues

@adamraine
Copy link
Member

@sisidovski I think your assessment is correct. Looks like we need to address this TODO.

const items = [
{
statistic: str_(UIStrings.statisticDOMElements),
element: '',
// TODO: these values should be numbers once `_renderNumeric` in details-renderer can handle them
value: i18n.formatNumber(stats.totalBodyElements),
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants