<ul dir="auto">
<li>[x ] I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>


<p dir="auto">I'm not able to see <code class="notranslate">console.log('some message')</code> when applied to a pages getInitialProps.</p>
<p dir="auto">Taking a fresh copy of next and creating an index page like so:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import React, { Component} from 'react'

export default class Index extends Component {
  async getInitialProps() {
    console.log('show your self')
  }
  render() {
    return (
      &lt;div&gt;Index Page&lt;/div&gt;
    )
  }
}"><pre class="notranslate"><code class="notranslate">import React, { Component} from 'react'

export default class Index extends Component {
  async getInitialProps() {
    console.log('show your self')
  }
  render() {
    return (
      &lt;div&gt;Index Page&lt;/div&gt;
    )
  }
}
</code></pre></div>
<p dir="auto">Running the server (in dev mode) and hitting the index page shows no message in terminal.</p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto">No log's at all</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>Create a new version of next.js project</li>
<li>Apply the above code to pages/index.js file</li>
<li>Run dev server</li>
<li>Check for logs after visiting  localhost:3000</li>
</ol>
<h2 dir="auto">Context</h2>


<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>4.1.4</td>
</tr>
<tr>
<td>node</td>
<td>9.2</td>
</tr>
<tr>
<td>OS</td>
<td>10.12.6 OSX</td>
</tr>
<tr>
<td>browser</td>
<td></td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">The server shouldn't spend 20ms to require the <code class="notranslate">Component</code> and the <code class="notranslate">Document</code> components.<br>
I believe we could <strong>use a cache to only pay the resolution cost once in production.</strong></p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">The requests are delayed by 20ms.<br>
It might get worse in the future version as the <a href="https://github.com/zeit/next.js/blob/cdbbe928b26af2e79c4508f127351b6652c5aee6/server/resolve.js"><code class="notranslate">/server/resolve.js</code></a> logic has grown to support 5 different extensions in canary:<br>
<a href="https://github.com/zeit/next.js/blob/cdbbe928b26af2e79c4508f127351b6652c5aee6/server/resolve.js#L36-L42">https://github.com/zeit/next.js/blob/cdbbe928b26af2e79c4508f127351b6652c5aee6/server/resolve.js#L36-L42</a></p>
<p dir="auto">where it only supports 2 in 4.2.3<br>
<a href="https://github.com/zeit/next.js/blob/44de0f15c96c425c193ffdccacb14f28051051d5/server/resolve.js#L33-L36">https://github.com/zeit/next.js/blob/44de0f15c96c425c193ffdccacb14f28051051d5/server/resolve.js#L33-L36</a></p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Server side render a page with the <code class="notranslate">--inspect</code> flag</li>
</ol>
<h2 dir="auto">Context</h2>
<p dir="auto">I have noticed the following issue investigating a server-side rendering slow issue.<br>
I have noticed that we systematically wait 20ms to require the <code class="notranslate">Component</code> and the <code class="notranslate">Document</code> components.</p>
<p dir="auto"><a href="https://github.com/zeit/next.js/blob/44de0f15c96c425c193ffdccacb14f28051051d5/server/render.js#L56-L59">https://github.com/zeit/next.js/blob/44de0f15c96c425c193ffdccacb14f28051051d5/server/render.js#L56-L59</a></p>
<p dir="auto">I believe a simple cache in production could make the resolution instant:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3165635/35807424-08b70ea6-0a83-11e8-97a9-98d9857ce199.png"><img src="https://user-images.githubusercontent.com/3165635/35807424-08b70ea6-0a83-11e8-97a9-98d9857ce199.png" alt="capture d ecran 2018-02-05 a 14 43 53" style="max-width: 100%;"></a></p>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>4.2.3</td>
</tr>
<tr>
<td>node</td>
<td>9.4.0</td>
</tr>
<tr>
<td>OS</td>
<td>macOS High Sierra 10.13.x</td>
</tr>
<tr>
<td>browser</td>
<td>N.A</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>