<p dir="auto"><code class="notranslate">with-external-scoped-css</code> is not perfect.<br>
In a slightly larger system, doing so will add a lot of work.<br>
I think <code class="notranslate">style jsx</code> is not a good idea, it can not and other open source UI framework very good integration.</p>
<p dir="auto">Have you considered using <code class="notranslate">sass</code> + <code class="notranslate">css modules</code> as the main technical point</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">Is it possible to detect reliably if a next.js app is running from server or via <code class="notranslate">next export</code> in <code class="notranslate">getInitialProps</code> and hence client side?</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Currently, I am using the presence of <code class="notranslate">res</code> in <code class="notranslate">getIntialProps</code> to find out but I realized that it won't be present for client-side navigation.</p>
<h2 dir="auto">Context</h2>
<p dir="auto">I am working on an app and testing the scenario where my backend is down. In an exported site, I should have all the data available already but my JS code calls backend in <code class="notranslate">getInitialProps</code> and crashes.</p>
<p dir="auto">In the place where I am catching this error, I can trigger a <code class="notranslate">location.reload()</code> to render the content statically and serve users without the backend being up.</p>
<p dir="auto">This is one of a few use cases.</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>v4.2.3</td>
</tr>
<tr>
<td>node</td>
<td>v8.4.0</td>
</tr>
<tr>
<td>OS</td>
<td>MacOS high sierra 10.13.3</td>
</tr>
<tr>
<td>browser</td>
<td>63.0.3239.132</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>