viewport dimensions are incorrect when starting angular app with 'ng serve'

Viewed 115

The topic sums it up, I have an angular app that I start with ...

ng serve

and I build using ...

ng build

When I build the application, deploy it, and go to the debug console on the home page of the app and run

> window.innerWidth
1280
> window.innerHeight
610

Which seem to be correct according to https://www.rapidtables.com/web/tools/window-size.html.

When I go to the home page of the app deployed locally (using ng serve) and run the same commands i get incorrect window sizes ...

> window.innerWidth
1707
> window.innerHeight
813

What could be causing this? I would supply more code but I don't even know where to start with this issue.

for some context, here is my index.html

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>RDF</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">

  <!-- Bootstrap 4 Autocomplete -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap-4-autocomplete/dist/bootstrap-4-autocomplete.min.js" crossorigin="anonymous"></script>

</head>
<body class="fill">
  <app-root></app-root>
</body>
</html>

Appreciate the help!

1 Answers

I have restarted the system and updated the window OS. Now it's showing correctly the viewport for ng serve and ng build.

Related