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

Even a simple html page gives the "Content Sized Correctly for Viewport" error #9777

Closed
camillo777 opened this issue Oct 3, 2019 · 9 comments

Comments

@camillo777
Copy link

camillo777 commented Oct 3, 2019

Error message is:
Content is not sized correctly for the viewportThe viewport size is 412px, whereas the window size is 1437px.
If the width of your app's content doesn't match the width of the viewport, your app might not be optimized for mobile screens. Learn more.

windows size is not the actual html windows size, but the Chrome app window size that obviously is never matching the html window size.

Provide the steps to reproduce

  1. Run LH on

Check with this simple HTML:

<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Food Ninja</title>
  <link rel="manifest" href="/manifest.json">
  <meta name="theme-color" content="#fff">
  <link rel="apple-touch-icon" href="public/icons/icon-192x192.png">
</head>
<body>
  ciao
</body>
</html>

What is the current behavior?

Lighthouse gives error:
Content is not sized correctly for the viewportThe viewport size is 412px, whereas the window size is 1437px.

What is the expected behavior?

There is no error.
At least the 1437px size is the HTML size not the Chrome app size

Environment Information

  • Affected Channels:
    Dev Tools on Chrome Version 77.0.3865.90 (Official Build) (64-bit)

  • Lighthouse version: Lighthouse 5.2.0

  • Node.js version:

  • Operating System: OSX 10.12.6

Related issues

@camillo777
Copy link
Author

Tried with the node.js Lighthouse app on the same page: test is passed.
Version is 5.5.0

M0010218224:~ camillo$ lighthouse --version
5.5.0

So it can be related to lighthouse 5.2.0 on Chrome

@patrickhulce
Copy link
Collaborator

patrickhulce commented Oct 3, 2019

Thanks for filing @camillo777! This was a bug in Chrome 77 that was fixed in Chrome 78 due out in a few weeks. (You can use Beta or Canary Chrome in the meantime)

See #9476 (comment)

@connorjclark
Copy link
Collaborator

Yup, you can use a fixed version in Chrome Beta today. But thanks for using our tool and caring enough to report a bug :)

@Malvoz
Copy link
Contributor

Malvoz commented Oct 14, 2020

I'm getting the same issue with this minimum viable HTML:

<!doctype html>
<h1>test</h1>

using Chrome v86.0.4240.75, however I don't see it in Canary 88.0.4292.0, can I assume it'll be fixed in a future Chrome version? Or should I open a Chromium bug?

@patrickhulce
Copy link
Collaborator

@Malvoz that would be working as intended as there is no meta viewport declaration on that snippet you provided.

@Malvoz
Copy link
Contributor

Malvoz commented Oct 14, 2020

@patrickhulce I guess I took "minimum viable HTML" to an extreme. I initially got the same issue with the following HTML:

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
  <h1>test</h1>
</body>
</html>

which I tested after debugging more complex HTML, for 1+ hour 😅

@patrickhulce
Copy link
Collaborator

I can't reproduce that in stable or canary :/

http://melodic-class.glitch.me/meta-viewport.html

image
image

Either way if it's fixed for you in Chrome Canary then there's no action for anyone to take outside of waiting :)

@Malvoz
Copy link
Contributor

Malvoz commented Oct 14, 2020

http://melodic-class.glitch.me/meta-viewport.html

Incorrect audit failure

Guess there's nothing TBD then. Thank you for your time @patrickhulce. :)

@patrickhulce
Copy link
Collaborator

That just means the audit doesn't apply to this page, not that it failed. This happens everywhere if you audit the page in desktop mode and WAI.

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

No branches or pull requests

4 participants