-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Cannot read property 'trim' of undefined #11606
Comments
Thanks very much for filing and for the bisect @tkindy! :) Seems like after #11248 all attributes aren't guaranteed to be defined anymore We'll need to be more careful about this when using them (and probably can't rely on the lighthouse/lighthouse-core/audits/seo/font-size.js Lines 77 to 84 in 636b55d
|
I dug into this issue further. As @patrickhulce noted, this problem occurs when DOM nodes have attributes without values such as <div class>
<p style="font-size: 10px">Hello, world!</p>
</div> In these cases, the ['class', undefined] Hence the error It felt a little weird to me that the selector it creates is for the parent of the text's element instead of the text's element directly. However, assuming that's the intended implementation, I have a fix for this bug that I'll open a PR for soon. |
I don't have a good explanation for this. I tracked it down to the original PR for this audit. I think it's related to this |
Provide the steps to reproduce
font-size
auditWhat is the current behavior?
Lighthouse errors out, saying:
What is the expected behavior?
Lighthouse doesn't error and reports the font size audit results.
Environment Information
Related issues
I used
git bisect
to find the PR that introduced this bug, #11248, first released in Lighthouse 6.3.0. I didn't dig any further than that, though. Let me know if I can help with anything else!The text was updated successfully, but these errors were encountered: