<ul dir="auto">
<li>[ 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.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>


<p dir="auto">It should not fire the error</p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto">I'm using custom express server and I'm getting this error page load</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;Home.getInitialProps()&quot; should resolve to an object. But found &quot;undefined&quot; instead."><pre class="notranslate"><code class="notranslate">"Home.getInitialProps()" should resolve to an object. But found "undefined" instead.
</code></pre></div>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>Use custom  express server</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="server.get('/home/:slug', (req, res) =&gt; {
		const { pathname, query }  = parse(req.url, true)
		return app.render(req, res, '/Faq', {
	 		slug: req.params.slug
		})
	})"><pre class="notranslate"><code class="notranslate">server.get('/home/:slug', (req, res) =&gt; {
		const { pathname, query }  = parse(req.url, true)
		return app.render(req, res, '/Faq', {
	 		slug: req.params.slug
		})
	})
</code></pre></div>
<ol start="2" dir="auto">
<li>Home component is like this</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export default class Faq extends Component {

	static async getInitialProps ({ req, query }) {
		console.log(query)
	}
      render() {
         &lt;div&gt; This is home &lt;/div&gt;
      }"><pre class="notranslate"><code class="notranslate">export default class Faq extends Component {

	static async getInitialProps ({ req, query }) {
		console.log(query)
	}
      render() {
         &lt;div&gt; This is home &lt;/div&gt;
      }
</code></pre></div>
<ol start="3" dir="auto">
<li>I'm gettting above error</li>
</ol>
<h2 dir="auto">Context</h2>


<p dir="auto">I want to render page dynamically as per the slug, without it I'm not able proceed further</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>6.0.2</td>
</tr>
<tr>
<td>node</td>
<td>9.2.0</td>
</tr>
<tr>
<td>OS</td>
<td>Mac</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome</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?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>


<p dir="auto"><code class="notranslate">&lt;Link&gt;</code> should produce a working link.</p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto">Using <code class="notranslate">&lt;Link&gt;</code> causes an error in console: <code class="notranslate">Did not expect server HTML to contain a &lt;a&gt; in &lt;div&gt;.</code></p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li><a href="https://github.com/fschroiff/hello-next">Clone my repo</a>, <code class="notranslate">npm i</code></li>
<li>Visit localhost:3000</li>
<li>Check console</li>
</ol>
<h2 dir="auto">Context</h2>


<p dir="auto">I am using Next.js for the first time. I am actually following the tutorial step for step. I got stuck on <a href="https://nextjs.org/learn/basics/navigate-between-pages/using-link" rel="nofollow">this step</a> ("Using Link").</p>
<p dir="auto">(I also noticed that sometimes the environment gets stuck in an infinite reload loop. For example when I added the <code class="notranslate">about.js</code> page. Or when I add and remove the <code class="notranslate">&lt;Link&gt;</code>-tag. That's probably a different issue...)</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>6.0.0</td>
</tr>
<tr>
<td>node</td>
<td>v8.9.4</td>
</tr>
<tr>
<td>OS</td>
<td>10.13.4</td>
</tr>
<tr>
<td>browser</td>
<td>Safari 11.1</td>
</tr>
<tr>
<td>npm</td>
<td>5.6.0</td>
</tr>
<tr>
<td>react</td>
<td>16.3.2</td>
</tr>
</tbody>
</table>