<h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">If SSR occurs on a page with scss imports, client-side routing works fine. If the SSR page does not include any scss imports, client-side routing then does not take place.</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>Clone and run example repo: <a href="https://github.com/kinetifex/next-sass-routing-bug">https://github.com/kinetifex/next-sass-routing-bug</a></li>
<li>Browse to <a href="http://localhost:3000/" rel="nofollow">http://localhost:3000/</a></li>
<li>Click on <code class="notranslate">With SCSS import</code> link</li>
<li>Notice route does not change and no errors present.
<ul dir="auto">
<li>Also note there is no <code class="notranslate">.css</code> downloaded in Network tab</li>
</ul>
</li>
</ol>
<p dir="auto">When it works:</p>
<ol dir="auto">
<li>Run example app</li>
<li>Browse to <a href="http://localhost:3000/with-scss" rel="nofollow">http://localhost:3000/with-scss</a>
<ul dir="auto">
<li>The <code class="notranslate">.css</code> file will download in Network tab</li>
</ul>
</li>
<li>Click on <code class="notranslate">Index</code> link</li>
<li>Click on <code class="notranslate">With SCSS import</code> link</li>
<li>Notice it works this time.</li>
</ol>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Routing to pages with scss imports should work.</p>
<h2 dir="auto">System information</h2>
<ul dir="auto">
<li>OS: macOS</li>
<li>Browser: chrome, firefox, safari</li>
<li>Version of Next.js: 7.0.2</li>
</ul>
<h2 dir="auto">Additional context</h2>
<p dir="auto">This is using <code class="notranslate">@zeit/next-sass</code> plugin, though I believe the error to be next.js related, possibly with <code class="notranslate">_document.js</code></p>
<p dir="auto">Noticied that in Safari (11.1), using the back/forward buttons with a custom express server fails to pass plain type objects via <code class="notranslate">getInitialProps</code>. This is causing errors due to running methods on <code class="notranslate">undefined</code> objects when users on Safari navigate using the back/forward buttons.</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?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">Objects passed from server routes through <code class="notranslate">gitInitialProps</code> should persist even when using back/forward buttons in the browser.</p>

<h2 dir="auto">Current Behavior</h2>

<p dir="auto">Objects passed from server routes through <code class="notranslate">gitInitialProps</code> are not persisting when using back/forward buttons in the browser.</p>

<h2 dir="auto">Steps to Reproduce (for bugs)</h2>

<p dir="auto">See this repo I created, it includes steps: <a href="https://github.com/jhoffmcd/next-test-custom-server#test-2">https://github.com/jhoffmcd/next-test-custom-server#test-2</a></p>

<h2 dir="auto">Context</h2>

<p dir="auto">I have a client site where a data object being passed by the server is not available on back/forward action, thus creating an error page for users. (Other types seem fine, arrays, strings, etc)<br>
Could be related to: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="238358041" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/2360" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/2360/hovercard" href="https://github.com/vercel/next.js/issues/2360">#2360</a><br>
If custom <code class="notranslate">popstate</code> handling is a must to ensure persistant SSR, can this be added to the <code class="notranslate">custom-server-express</code> example or documented more clearly somewhere?</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>5.0.1</td>
</tr>
<tr>
<td>node</td>
<td>8.9.4</td>
</tr>
<tr>
<td>OS</td>
<td>osx 10.13.4</td>
</tr>
<tr>
<td>browser</td>
<td>safari 11.1</td>
</tr>
<tr>
<td>express</td>
<td>4.14.0</td>
</tr>
<tr>
<td>react</td>
<td>16.3.0</td>
</tr>
</tbody>
</table>