<h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto"><code class="notranslate">next build</code> fails with following error after upgrade to Next 9.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ Error: Module did not self-register.
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:857:18)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.&lt;anonymous&gt; (/home/vista1nik/Documents/nextjs-project/node_modules/grpc/src/grpc_extension.js:32:13)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12) type: 'Error', '$error': '$error' }"><pre class="notranslate"><code class="notranslate">{ Error: Module did not self-register.
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:857:18)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.&lt;anonymous&gt; (/home/vista1nik/Documents/nextjs-project/node_modules/grpc/src/grpc_extension.js:32:13)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12) type: 'Error', '$error': '$error' }
</code></pre></div>
<p dir="auto">Error happens after compilation.<br>
Last Build trigger before error is:<br>
<a href="https://github.com/zeit/next.js/blob/5a54e8715a7a7a92175addc19f4ec9f8f7bbd2e7/packages/next/build/index.ts#L342">https://github.com/zeit/next.js/blob/5a54e8715a7a7a92175addc19f4ec9f8f7bbd2e7/packages/next/build/index.ts#L342</a></p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto"><a href="https://github.com/jpbow/module-register-build-issue">https://github.com/jpbow/module-register-build-issue</a></p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto"><code class="notranslate">next build</code> success</p>
<h2 dir="auto">System information</h2>
<ul dir="auto">
<li>OS: Arch Linux</li>
<li>Version of Next.js: 9.0.0</li>
</ul>
<h2 dir="auto">Additional context</h2>
<p dir="auto">Tried <code class="notranslate">yarn install --force</code>and Clean depends install.</p>
<p dir="auto"><code class="notranslate">next .</code> dev-command work properly.</p>
<p dir="auto">Following instructions on with-apollo example on master (v2.4.6) fails to build.</p>


<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">Should build and run.</p>
<h2 dir="auto">Current Behavior</h2>


<blockquote>
<p dir="auto">Failed to build on /var/folders/g0/40w25pdx4r166gr3dr2dszr80000gn/T/73a90ccb-e790-431e-bab9-5ffba7560413<br>
{ Error: ./components/App.js<br>
Module not found: Error: Can't resolve 'next/node_modules/styled-jsx/style.js' in '/Lair/with-apollo/components'<br>
resolve 'next/node_modules/styled-jsx/style.js' in '/Lair/with-apollo/components'<br>
Parsed request is a module<br>
using description file: /Lair/with-apollo/package.json (relative path: ./components)<br>
Field 'browser' doesn't contain a valid alias configuration<br>
after using description file: /Lair/with-apollo/package.json (relative path: ./components)<br>
resolve as module</p>
</blockquote>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>Follow instructions to download with-apollo example</li>
<li>next build</li>
<li>observe build error</li>
<li></li>
</ol>
<h2 dir="auto">Context</h2>


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

<ul dir="auto">
<li>Next.js version: v2.6.4</li>
<li>Environment name and version (e.g. Chrome 39, Node.js 5.4): node 7.2</li>
<li>Operating System (Linux, maxOS, Windows): osx</li>
</ul>