<p dir="auto">Hi everyone,</p>
<p dir="auto">Sorry in advance if it's duplicated. Feel free to link me to the original issue</p>
<h1 dir="auto">Bug report</h1>
<p dir="auto">getInitialProps is called but doesn't return any props</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">I'm using a combination of all of the examples listed below :</p>
<ul dir="auto">
<li>custom-server-express</li>
<li>with-<a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/NEXT-css">next-css</a></li>
<li>with-<a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/NEXT-routes">next-routes</a></li>
<li>with-react-i18next</li>
<li>with-redux</li>
</ul>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Returning the props and access them in the render method and all the other lifecycle methods</p>
<h2 dir="auto">Code</h2>
<p dir="auto">My routes are declared in /src/routes.js and it looks like this</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const routes = require('next-routes')

module.exports = routes()
  .add({ name: 'HomePage', pattern: '/', page: '/Home/Home' })
  .add('test')"><pre class="notranslate"><code class="notranslate">const routes = require('next-routes')

module.exports = routes()
  .add({ name: 'HomePage', pattern: '/', page: '/Home/Home' })
  .add('test')
</code></pre></div>
<p dir="auto">and here is the code of my homepage in /src/pages/Home/Home</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class HomePage extends Component {
  static async getInitialProps({ reduxStore, query, req }) {
    const isServer = !!req
    if (isServer) {
      const locale = utils.parseLanguage(req.headers['accept-language'])
      const device = utils.parseUA(req.headers['user-agent'])
      const { pathname } = utils.parseUrl(req.url)
      await Promise.all([
        reduxStore.dispatch(detectDeviceType(device)),
        reduxStore.dispatch(updateAppRoute({ pathname, query })),
        reduxStore.dispatch(fetchChartsWeek(locale)),
        reduxStore.dispatch(fetchTrendings(locale)),
      ])
    }
    return { isServer, query }
  }

  componentDidMount() {
    console.log(this.props) // everything i need but no query or isServer..."><pre class="notranslate"><code class="notranslate">class HomePage extends Component {
  static async getInitialProps({ reduxStore, query, req }) {
    const isServer = !!req
    if (isServer) {
      const locale = utils.parseLanguage(req.headers['accept-language'])
      const device = utils.parseUA(req.headers['user-agent'])
      const { pathname } = utils.parseUrl(req.url)
      await Promise.all([
        reduxStore.dispatch(detectDeviceType(device)),
        reduxStore.dispatch(updateAppRoute({ pathname, query })),
        reduxStore.dispatch(fetchChartsWeek(locale)),
        reduxStore.dispatch(fetchTrendings(locale)),
      ])
    }
    return { isServer, query }
  }

  componentDidMount() {
    console.log(this.props) // everything i need but no query or isServer...
</code></pre></div>
<p dir="auto">a simpler exemple in /src/pages/test.js</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  static async getInitialProps({ req }) {
    const isServer = !!req
    return { isServer }
  }

  render() {
    console.log(this.props) // {}"><pre class="notranslate"><code class="notranslate">  static async getInitialProps({ req }) {
    const isServer = !!req
    return { isServer }
  }

  render() {
    console.log(this.props) // {}
</code></pre></div>
<p dir="auto">I really need to know whether the page is being rendered by the server or the client as i don't want to show placeholders when it is SSR and only display them when we naviguate to the page client side, so that in componentDidMount i would like to show placeholders and fetch data only when isServer = false if that makes sense.</p>
<p dir="auto">Does anyone already accountered this issue ?<br>
I really would like to switch to Nextjs. Currently we have our code base running in a CRA setup. We now have trouble with SEO so switching to nextjs seemed to be a great solution. However it is those kind of issues that are keeping me from adopting it completely :(</p>
<p dir="auto">Any help or suggestions would be really appreciated</p>
<p dir="auto">Thanks in advance</p>
<p dir="auto">When downloading, installing and running the Material UI example application, I am met with the following compile error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="These dependencies were not found:

* react-dom/lib/EventConstants in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/EventPluginHub in ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js
* react-dom/lib/EventPluginUtils in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/EventPropagators in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/SyntheticUIEvent in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/ViewportMetrics in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js

To install them, you can run: npm install --save react-dom/lib/EventConstants react-dom/lib/EventPluginHub react-dom/lib/EventPluginUtils react-dom/lib/EventPropagators react-dom/lib/SyntheticUIEvent react-dom/lib/ViewportMetrics
{ Invariant Violation: injectTapEventPlugin(): Can only be called once per application lifecycle.

It is recommended to call injectTapEventPlugin() just before you call ReactDOM.render(). If you are using an external library which calls injectTapEventPlugin() itself, please contact the maintainer as it shouldn't be called in library code and should be injected by the application.
    at invariant (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/fbjs/lib/invariant.js:42:15)
    at injectTapEventPlugin (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js:11:5)
    at Object.&lt;anonymous&gt; (/Users/michaelfriedman/Local/projects/with-material-ui-app/pages/index.js:14:3)
    at Module._compile (module.js:635:30)
    at Module._compile (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/source-map-support/source-map-support.js:492:25)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17) name: 'Invariant Violation', framesToPop: 1 }
{ Invariant Violation: injectTapEventPlugin(): Can only be called once per application lifecycle.

It is recommended to call injectTapEventPlugin() just before you call ReactDOM.render(). If you are using an external library which calls injectTapEventPlugin() itself, please contact the maintainer as it shouldn't be called in library code and should be injected by the application.
    at invariant (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/fbjs/lib/invariant.js:42:15)
    at injectTapEventPlugin (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js:11:5)
    at Object.&lt;anonymous&gt; (/Users/michaelfriedman/Local/projects/with-material-ui-app/pages/index.js:14:3)
    at Module._compile (module.js:635:30)
    at Module._compile (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/source-map-support/source-map-support.js:492:25)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17) name: 'Invariant Violation', framesToPop: 1 }"><pre class="notranslate"><code class="notranslate">These dependencies were not found:

* react-dom/lib/EventConstants in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/EventPluginHub in ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js
* react-dom/lib/EventPluginUtils in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/EventPropagators in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/SyntheticUIEvent in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js
* react-dom/lib/ViewportMetrics in ./node_modules/react-tap-event-plugin/src/TapEventPlugin.js

To install them, you can run: npm install --save react-dom/lib/EventConstants react-dom/lib/EventPluginHub react-dom/lib/EventPluginUtils react-dom/lib/EventPropagators react-dom/lib/SyntheticUIEvent react-dom/lib/ViewportMetrics
{ Invariant Violation: injectTapEventPlugin(): Can only be called once per application lifecycle.

It is recommended to call injectTapEventPlugin() just before you call ReactDOM.render(). If you are using an external library which calls injectTapEventPlugin() itself, please contact the maintainer as it shouldn't be called in library code and should be injected by the application.
    at invariant (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/fbjs/lib/invariant.js:42:15)
    at injectTapEventPlugin (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js:11:5)
    at Object.&lt;anonymous&gt; (/Users/michaelfriedman/Local/projects/with-material-ui-app/pages/index.js:14:3)
    at Module._compile (module.js:635:30)
    at Module._compile (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/source-map-support/source-map-support.js:492:25)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17) name: 'Invariant Violation', framesToPop: 1 }
{ Invariant Violation: injectTapEventPlugin(): Can only be called once per application lifecycle.

It is recommended to call injectTapEventPlugin() just before you call ReactDOM.render(). If you are using an external library which calls injectTapEventPlugin() itself, please contact the maintainer as it shouldn't be called in library code and should be injected by the application.
    at invariant (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/fbjs/lib/invariant.js:42:15)
    at injectTapEventPlugin (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js:11:5)
    at Object.&lt;anonymous&gt; (/Users/michaelfriedman/Local/projects/with-material-ui-app/pages/index.js:14:3)
    at Module._compile (module.js:635:30)
    at Module._compile (/Users/michaelfriedman/Local/projects/with-material-ui-app/node_modules/source-map-support/source-map-support.js:492:25)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17) name: 'Invariant Violation', framesToPop: 1 }
</code></pre></div>
<ul dir="auto">
<li>[x ] 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">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>4.2.1</td>
</tr>
<tr>
<td>node</td>
<td>8.9.1</td>
</tr>
<tr>
<td>OS</td>
<td>High Sierra</td>
</tr>
<tr>
<td>browser</td>
<td>Firefox Developer Edition</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>