question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

meta-viewport: Cannot read property 'toLowerCase' of undefined

See original GitHub issue

We’ve been getting a bunch of users hitting the same snag recently: https://github.com/GoogleChrome/lighthouse/issues/10908

It now looks like it’s all due to the meta-viewport rule. It’s marked as incomplete and has an .error.message of Cannot read property 'toLowerCase' of undefined.

We’re using axe 3.5.3 and briefly looking at the changelog I have a suspicion our culprit is #2137 (“fix(meta-viewport): parse negative and string values for maximum-scale”)… which does include a few calls to toLowerCase().

@widmanski’s comment has a conjecture that looks compelling to me:

Update I’m pretty sure the error resulted from axe-core failing to parse our viewport tag due to legacy / invalid content (we copied it over from the previous version of the website) - <meta name="viewport" content="width=device-width,initial-scale=1,minimal-ui"> - minimal-ui is likely what causes this. We’ll be removing it soon, so lighthouse may actually start to correctly score accessibility on the reported page once you read this.

Edit: fwiw in Lighthouse we’ve been using https://github.com/dontcallmedom/metaviewport-parser for a while. Weight-wise it’s certainly heavier than your implementation, but it’s quite careful and thorough.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
strakercommented, Jun 5, 2020

It should make it into the 4.0 release.

1reaction
strakercommented, Jun 5, 2020

@bhavin7181 we are currently working on a fix for that bug. It might be related to #2261 or #2262.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'toLowerCase' of undefined postcss
I was using angular metronic. I got the same error and after a long time I found the wrong code block and commented...
Read more >
Cannot read property 'toLowerCase' of undefined
hello i am try to check seo in my post data butits not open tabs after check in console it have error on...
Read more >
cannot read properties of null (reading 'controls') - You.com
The cannot read property of null error occurs in JavaScript by: Calling a “click ()” function on a “null” value i.e DOM element...
Read more >
iOS: Cannot read property 'toLowerCase' of undefined - ionic-v3
So I tried to test it with my real phone and it worked as well. But now I'm getting this error: Reading build...
Read more >
axe-core/axe.js - chromium/src/third_party - Git at Google
utils.forEach(requestHeaders, function setRequestHeader(val, key) {. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found