title: Next.js: getInitialProps not working with history (back button)
body: <p>I have an app with a single page <code>index.js</code>, and I parse the query parameters in <code>getInitialProps</code>:</p>
  
  <pre><code>static async getInitialProps ({query}) {
      console.log('PAGE', query.screenId);
      try {
          const projectData = await ProjectLoader.loadProject(query);
          return projectData;
      }
      catch (err) {
          console.error(err);
      }
  };
  </code></pre>
  
  <p>I use <code>&lt;Link href={pathname, query} prefetch&gt;</code> tags to build my links.</p>
  
  <p>The <code>screenId</code> property is key to finding the right page to render.</p>
  
  <p>However, when I use the back button in the browser to a page without <code>screenId</code> set, <code>getInitialProps</code> doesn’t return <code>screenId:undefined</code> as expected, but another value (as you can see in the console log):</p>
  
  <p><a href="https://i.stack.imgur.com/pWUXE.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pWUXE.gif" alt="getInitialProps not working with history"></a></p>
  
  <p>When I refresh the page, I get the right properties and see the correct results.</p>
  
  <p>The “imaginary” <code>screenId</code> is actually a valid value, but I have no idea where this value comes from.</p>
  
  <p>Why is this happening?</p>