title: Navigating in a WinJS app always throws an exception
body: <p>Every time I try to perform a navigation in the ready function of a page, the application crashes.</p>
  
  <p>Specifically, it fails at the <code>WinJS.Navigation.navigate("/pages/login/login.html", {});</code> line below:</p>
  
  <pre><code>// This function is called whenever a user navigates to this page. It
  // populates the page elements with the app's data.
  ready: function (element, options) {            
  
      var listView = element.querySelector(".groupeditemslist").winControl;
      listView.groupHeaderTemplate = element.querySelector(".headertemplate");
      listView.itemTemplate = element.querySelector(".itemtemplate");
      listView.oniteminvoked = this._itemInvoked.bind(this);
  
      // Set up a keyboard shortcut (ctrl + alt + g) to navigate to the
      // current group when not in snapped mode.
      listView.addEventListener("keydown", function (e) {
          if (appView.value !== appViewState.snapped &amp;&amp; e.ctrlKey &amp;&amp; e.keyCode === WinJS.Utilities.Key.g &amp;&amp; e.altKey) {
              var data = listView.itemDataSource.list.getAt(listView.currentItem.index);
              this.navigateToGroup(data.group.key);
              e.preventDefault();
              e.stopImmediatePropagation();
          }
      }.bind(this), true);
  
      this._initializeLayout(listView, appView.value);
      listView.element.focus();
  
      initialize();
  }
  
  function initialize() {
      // Check if user is logged in
      if (is_logged_in !== true) {
          WinJS.Navigation.navigate("/pages/login/login.html", {});
      }
      else {
          // TODO: Replace the data with your real data.
          // You can add data from asynchronous sources whenever it becomes available.
          generateSampleData().forEach(function (item) {
              list.push(item);
          });
      }
  }
  </code></pre>
  
  <p>Anyone know why this happens?</p>