Issue 1:
[x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

yarn install then yarn dev should result in a running program.

Current Behavior

Get this error

(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.<anonymous> (/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

Your Environment

Tech
Version

next
6.0.0

node
9.8.0

OS
macOS 10.13.4

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

This issue might be somewhat similar to #2668, however the provided workaround does not fix my problem.

Expected Behavior

Assuming I am at the following route '/docs/imgproc', if I keep on pushing the exact same route, e.g.: router.push('/docs?cvModule=imgproc', '/docs/imgproc#boundingRect', { shallow: true }) I would assume getInitialProps not to be called repeatedly as the route did not change and I am pushing with shallow option.

Current Behavior

The first time I push a new route via: router.push('/docs?cvModule=imgproc', '/docs/imgproc#boundingRect', { shallow: true }) getInitialProps is called as I would expect. However, executing the exact same push again it should not call getInitialProps again, especially with { shallow: true }, or am I missing something here?

Furthermore, looking at router.router.asPath, I get the following: '/docs/imgproc#boundingRect'. If I slightly modify the asPath, e.g.: router.push('/docs?cvModule=imgproc', '/docs/imgproc#bounding', { shallow: true }) getInitialProps is not called, as expected. If I push with the exact same asPath it keeps being called repeatedly.

The above explained behaviour also applies with the 'next/link' component. That's how I initially discovered the issue.

Context

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 { shallow: true } 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?

Your Environment

Tech
Version

next
4.1.4

node
9.2.0

OS
win7 x64

browser
chrome 63.0