<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">Get initial <code class="notranslate">props</code> using a HOC in <code class="notranslate">_app.js</code> same as when using directly in all <em>pages</em></p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto">Using custom <code class="notranslate">_app.js</code> works only client-side</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>Fork/install <a href="https://github.com/zeit/next.js/tree/canary/examples/with-apollo">with-apollo example</a></li>
<li>Create a <em>custom</em> <code class="notranslate">_app.js</code> like <a href="https://github.com/zeit/next.js#custom-app">here</a></li>
<li>Import and Wrap the default exported <em>Component</em> of <code class="notranslate">_app.js</code> with <a href="https://github.com/zeit/next.js/blob/canary/examples/with-apollo/lib/withData.js">withData</a> :: <a href="#code-snippet-_app">see below</a></li>
<li>Unwrap the default exported Component from <a href="https://github.com/zeit/next.js/blob/canary/examples/with-apollo/pages/index.js#L7">Index page</a> :: <a href="#code-snippet-index">see below</a></li>
</ol>
<h2 dir="auto">Context</h2>


<p dir="auto">When the <code class="notranslate">withData</code> <em>HOC</em> wraps each <em>Page</em>, the <em>GraphQL</em> data fetched is available <em>server-side</em> like:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/784056/39698251-67931736-51f4-11e8-871f-986c884360d0.png"><img src="https://user-images.githubusercontent.com/784056/39698251-67931736-51f4-11e8-871f-986c884360d0.png" alt="withData wrapping each page" style="max-width: 100%;"></a></p>
<p dir="auto">instead wrapping the <em>custom</em> <code class="notranslate">_app.js</code> is only available <em>client-side</em>, like:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/784056/39698280-8f6f1566-51f4-11e8-933b-f1bd78bebec8.png"><img src="https://user-images.githubusercontent.com/784056/39698280-8f6f1566-51f4-11e8-933b-f1bd78bebec8.png" alt="withData wrapping custom _app" style="max-width: 100%;"></a></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.11.0</td>
</tr>
<tr>
<td>OS</td>
<td>OSX 10.11.6</td>
</tr>
<tr>
<td>browser</td>
<td></td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>
<h3 dir="auto">Code snippets</h3>
<h3 dir="auto">Code Snippet _app</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import App, { Container } from 'next/app'
import React from 'react'
import withData from '../lib/withData'

class MyApp extends App {
  static async getInitialProps({ Component, router, ctx }) {
    let pageProps = {}

    if (Component.getInitialProps) {
      pageProps = await Component.getInitialProps(ctx)
    }

    return { pageProps }
  }

  render() {
    const { Component, pageProps } = this.props
    return (
      &lt;Container&gt;
        &lt;Component {...pageProps} /&gt;
      &lt;/Container&gt;
    )
  }
}

export default withData(MyApp)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">App</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-v">Container</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'next/app'</span>
<span class="pl-k">import</span> <span class="pl-v">React</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span>
<span class="pl-k">import</span> <span class="pl-s1">withData</span> <span class="pl-k">from</span> <span class="pl-s">'../lib/withData'</span>

<span class="pl-k">class</span> <span class="pl-v">MyApp</span> <span class="pl-k">extends</span> <span class="pl-v">App</span> <span class="pl-kos">{</span>
  <span class="pl-k">static</span> <span class="pl-k">async</span> <span class="pl-en">getInitialProps</span><span class="pl-kos">(</span><span class="pl-kos">{</span> Component<span class="pl-kos">,</span> router<span class="pl-kos">,</span> ctx <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-s1">pageProps</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Component</span><span class="pl-kos">.</span><span class="pl-c1">getInitialProps</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-s1">pageProps</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-v">Component</span><span class="pl-kos">.</span><span class="pl-en">getInitialProps</span><span class="pl-kos">(</span><span class="pl-s1">ctx</span><span class="pl-kos">)</span>
    <span class="pl-kos">}</span>

    <span class="pl-k">return</span> <span class="pl-kos">{</span> pageProps <span class="pl-kos">}</span>
  <span class="pl-kos">}</span>

  <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-kos">{</span> Component<span class="pl-kos">,</span> pageProps <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span>
    <span class="pl-k">return</span> <span class="pl-kos">(</span>
      <span class="pl-c1">&lt;</span><span class="pl-ent">Container</span><span class="pl-c1">&gt;</span>
        <span class="pl-c1">&lt;</span><span class="pl-ent">Component</span> <span class="pl-kos">{</span>...<span class="pl-s1">pageProps</span><span class="pl-kos">}</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
      <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">Container</span><span class="pl-c1">&gt;</span>
    <span class="pl-kos">)</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">withData</span><span class="pl-kos">(</span><span class="pl-v">MyApp</span><span class="pl-kos">)</span></pre></div>
<h3 dir="auto">Code Snippet Index</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import App from '../components/App'
import Header from '../components/Header'
import Submit from '../components/Submit'
import PostList from '../components/PostList'

export default () =&gt; (
  &lt;App&gt;
    &lt;Header /&gt;
    &lt;Submit /&gt;
    &lt;PostList /&gt;
  &lt;/App&gt;
)
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">App</span> <span class="pl-k">from</span> <span class="pl-s">'../components/App'</span>
<span class="pl-k">import</span> <span class="pl-v">Header</span> <span class="pl-k">from</span> <span class="pl-s">'../components/Header'</span>
<span class="pl-k">import</span> <span class="pl-v">Submit</span> <span class="pl-k">from</span> <span class="pl-s">'../components/Submit'</span>
<span class="pl-k">import</span> <span class="pl-v">PostList</span> <span class="pl-k">from</span> <span class="pl-s">'../components/PostList'</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">(</span>
  <span class="pl-c1">&lt;</span><span class="pl-ent">App</span><span class="pl-c1">&gt;</span>
    <span class="pl-c1">&lt;</span><span class="pl-ent">Header</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    <span class="pl-c1">&lt;</span><span class="pl-ent">Submit</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    <span class="pl-c1">&lt;</span><span class="pl-ent">PostList</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
  <span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">App</span><span class="pl-c1">&gt;</span>
<span class="pl-kos">)</span></pre></div>
<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">Next.js export and Next.js should result in an eventually consistent state when dealing with network request (with requests originating from server, client or both).</p>
<p dir="auto">If it is an <code class="notranslate">next export</code> deployment then I need to refresh the content on top of the snapshot content but with <code class="notranslate">now</code> deployment, if SSR works, client refresh is not required.</p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto">A deployment with now works flawlessly with SSR - <a href="https://self.now.sh" rel="nofollow">https://self.now.sh</a></p>
<p dir="auto">A deployment with <code class="notranslate">next export</code> shows the snapshot of when the export happened but does not refresh the data on client site - <a href="https://self.netlify.com" rel="nofollow">https://self.netlify.com</a></p>
<p dir="auto">Both the above are deployments of same commit id but backend has an extra entry (resume) after the deployments. Now deployment shows it but Netlify depoyment does not.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>Links provided above</li>
</ol>
<h2 dir="auto">Context</h2>


<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.0</td>
</tr>
<tr>
<td>node</td>
<td>8.4.0</td>
</tr>
<tr>
<td>OS</td>
<td>macOS Sierra - 10.12.6</td>
</tr>
<tr>
<td>browser</td>
<td>Version 61.0.3163.100 (Official Build) (64-bit)</td>
</tr>
</tbody>
</table>