Sometimes, when using React libraries, such as react-router, I get this error:
Uncaught TypeError: Cannot read property \'firstChild\' of undefined
If you are experiencing this crash while server side rendering and none of these answers are the problem, here's the likely culprit:
Doing something async (setTimeout, AJAX, etc.) in componentWillMount. Since componentWillMount is called on the server, this setTimeout/request will still fire. If you setState inside this callback then it'll cause the error above.