<p dir="auto">I started from <a href="https://github.com/zeit/next.js/tree/canary/examples/with-firebase-hosting">this</a> example. Changed nothing more than what is explained in there to get up and running.</p>
<p dir="auto">npm run dev works perfectly.<br>
npm run serve (firebase local) throws me the following:</p>
<p dir="auto">Error: &gt; Couldn't find a <code class="notranslate">pages</code> directory. Please create one under the project root<br>
at Object.findPagesDir (/Users/julianbenegas/Documents/Work/mayeutica-platform-2.nosync/dist/functions/node_modules/next/dist/lib/find-pages-dir.js:3:170)<br>
at new Server (/Users/julianbenegas/Documents/Work/mayeutica-platform-2.nosync/dist/functions/node_modules/next/dist/<a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/NEXT-server">next-server</a>/server/<a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/NEXT-server">next-server</a>.js:40:42)<br>
at createServer (/Users/julianbenegas/Documents/Work/mayeutica-platform-2.nosync/dist/functions/node_modules/next/dist/server/next.js:2:133)<br>
at Object. (/Users/julianbenegas/Documents/Work/mayeutica-platform-2.nosync/dist/functions/index.js:10:11)<br>
at Module._compile (internal/modules/cjs/loader.js:778:30)<br>
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)<br>
at Module.load (internal/modules/cjs/loader.js:653:32)<br>
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)<br>
at Function.Module._load (internal/modules/cjs/loader.js:585:3)<br>
at Module.require (internal/modules/cjs/loader.js:692:17)<br>
<g-emoji class="g-emoji" alias="warning" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/26a0.png">⚠</g-emoji>  Your function was killed because it raised an unhandled error.</p>
<p dir="auto">Cheers!<br>
<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jthegedus/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jthegedus">@jthegedus</a></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">I expected the data fetching to happen server-side on first load and be cached</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Data is fetched by the client (I see the network request) on first load</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Decorate an inner component (in my case, the header) with "withRouter"</li>
<li>Use router.pathname.<br>
In my case <code class="notranslate">const activeItem = router.pathname</code> to set active item on menu</li>
<li>Now, using the lib of the with-apollo example (initApollo and withData) data is fetched client-side.</li>
</ol>
<p dir="auto">If I remove that line everything is ok and I don't see any client-side fetching.</p>
<p dir="auto">Thank you,<br>
Matteo</p>