title: Strange console.log behavior
body: <p>In next.js, <code>getInitialProps</code> can run on server or client. On client <code>ctx.req</code> is undefined. To get cookies i check this and log cookies. Problem is that <code>console.log</code> with initial string gives me error. I think i'm missing something here, but not sure what...</p>
  
  <p>Error is:</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'headers' of undefined</p>
  </blockquote>
  
  <pre><code>Test.getInitialProps = async (ctx: any): Promise&lt;any&gt; =&gt; {
    console.log(ctx.req ? ctx.req.headers.cookie : document.cookie) // works
    console.log('cookies:' + ctx.req ? ctx.req.headers.cookie : document.cookie) // error
  
    return { init: 1 }
  }
  </code></pre>
  
  <p><a href="https://i.imgur.com/D0suqQo.png" rel="nofollow noreferrer"><img src="https://i.imgur.com/D0suqQo.png" alt="enter image description here"></a></p>