<p dir="auto">[x] I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</p>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto"><code class="notranslate">yarn install</code> then <code class="notranslate">yarn dev</code> should result in a running program.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Get this error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(node:79838) UnhandledPromiseRejectionWarning: Error: Cannot find module './dist/server/build/babel/preset'
    at Function.Module._resolveFilename (module.js:543:15)
    at Function.Module._load (module.js:470:25)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at Object.&lt;anonymous&gt; (/Users/trent/home/projects/Grok/tmp/next.js/babel.js:1:18)
    at Module._compile (module.js:649:30)
    at Module.m._compile (/Users/trent/home/projects/Grok/tmp/next.js/examples/custom-server-typescript/node_modules/ts-node/src/index.ts:422:23)
    at Module._extensions..js (module.js:660:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/trent/home/projects/Grok/tmp/next.js/examples/custom-server-typescript/node_modules/ts-node/src/index.ts:425:12)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at requireModule (/Users/trent/home/projects/Grok/tmp/next.js/examples/custom-server-typescript/node_modules/@babel/core/lib/config/files/plugins.js:142:12)
    at loadPreset (/Users/trent/home/projects/Grok/tmp/next.js/examples/custom-server-typescript/node_modules/@babel/core/lib/config/files/plugins.js:56:15)
(node:79838) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:79838) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[nodemon] clean exit - waiting for changes before restart
"><pre class="notranslate"><code class="notranslate">(node:79838) UnhandledPromiseRejectionWarning: Error: Cannot find module './dist/server/build/babel/preset'
    at Function.Module._resolveFilename (module.js:543:15)
    at Function.Module._load (module.js:470:25)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at Object.&lt;anonymous&gt; (/Users/trent/home/projects/Grok/tmp/next.js/babel.js:1:18)
    at Module._compile (module.js:649:30)
    at Module.m._compile (/Users/trent/home/projects/Grok/tmp/next.js/examples/custom-server-typescript/node_modules/ts-node/src/index.ts:422:23)
    at Module._extensions..js (module.js:660:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/trent/home/projects/Grok/tmp/next.js/examples/custom-server-typescript/node_modules/ts-node/src/index.ts:425:12)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at requireModule (/Users/trent/home/projects/Grok/tmp/next.js/examples/custom-server-typescript/node_modules/@babel/core/lib/config/files/plugins.js:142:12)
    at loadPreset (/Users/trent/home/projects/Grok/tmp/next.js/examples/custom-server-typescript/node_modules/@babel/core/lib/config/files/plugins.js:56:15)
(node:79838) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:79838) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[nodemon] clean exit - waiting for changes before restart

</code></pre></div>
<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>6.0.0</td>
</tr>
<tr>
<td>node</td>
<td>9.8.0</td>
</tr>
<tr>
<td>OS</td>
<td>macOS 10.13.4</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>
<p dir="auto">This issue might be somewhat similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="246183127" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/2668" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/2668/hovercard" href="https://github.com/vercel/next.js/issues/2668">#2668</a>, however the provided workaround does not fix my problem.</p>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Assuming I am at the following route <code class="notranslate">'/docs/imgproc'</code>, if I keep on pushing the exact same route, e.g.: <code class="notranslate">router.push('/docs?cvModule=imgproc', '/docs/imgproc#boundingRect', { shallow: true })</code> I would assume <code class="notranslate">getInitialProps</code> not to be called repeatedly as the route did not change and I am pushing with shallow option.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">The first time I push a new route via: <code class="notranslate">router.push('/docs?cvModule=imgproc', '/docs/imgproc#boundingRect', { shallow: true })</code> <code class="notranslate">getInitialProps</code> is called as I would expect. However, executing the exact same push again it should not call <code class="notranslate">getInitialProps</code> again, especially with <code class="notranslate">{ shallow: true }</code>, or am I missing something here?</p>
<p dir="auto">Furthermore, looking at <code class="notranslate">router.router.asPath</code>, I get the following: <code class="notranslate">'/docs/imgproc#boundingRect'</code>. If I slightly modify the asPath, e.g.: <code class="notranslate">router.push('/docs?cvModule=imgproc', '/docs/imgproc#bounding', { shallow: true })</code> <code class="notranslate">getInitialProps</code> is not called, as expected. If I push with the exact same asPath it keeps being called repeatedly.</p>
<p dir="auto">The above explained behaviour also applies with the 'next/link' component. That's how I initially discovered the issue.</p>
<h2 dir="auto">Context</h2>
<p dir="auto">What I want to achieve, is to prevent the page from being rerendered if the route is the same with a different hash value. As <code class="notranslate">{ shallow: true }</code> does not seem to work in case the asPath is the same, I assume the only option is to write a custom Link component which parses the asPath and the hash value?</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.1.4</td>
</tr>
<tr>
<td>node</td>
<td>9.2.0</td>
</tr>
<tr>
<td>OS</td>
<td>win7 x64</td>
</tr>
<tr>
<td>browser</td>
<td>chrome 63.0</td>
</tr>
</tbody>
</table>