Issue 1:
Hi everyone,

Sorry in advance if it's duplicated. Feel free to link me to the original issue

Bug report

getInitialProps is called but doesn't return any props

To Reproduce

I'm using a combination of all of the examples listed below :

custom-server-express

with-next-css

with-next-routes

with-react-i18next

with-redux

Expected behavior

Returning the props and access them in the render method and all the other lifecycle methods

Code

My routes are declared in /src/routes.js and it looks like this

const routes = require('next-routes')

module.exports = routes()
.add({ name: 'HomePage', pattern: '/', page: '/Home/Home' })
.add('test')

and here is the code of my homepage in /src/pages/Home/Home

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...

a simpler exemple in /src/pages/test.js

static async getInitialProps({ req }) {
const isServer = !!req
return { isServer }
}

render() {
console.log(this.props) // {}

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.

Does anyone already accountered this issue ?

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 :(

Any help or suggestions would be really appreciated

Thanks in advance

Issue 2:
When downloading, installing and running the Material UI example application, I am met with the following compile error:

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.<anonymous> (/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.<anonymous> (/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 }

[x ] I have searched the issues of this repository and believe that this is not a duplicate.

Your Environment

Tech
Version

next
4.2.1

node
8.9.1

OS
High Sierra

browser
Firefox Developer Edition

etc