Sometimes, when using React libraries, such as react-router, I get this error:
Uncaught TypeError: Cannot read property \'firstChild\' of undefined
Using require('react')
and require('React')
inconsistently causes this problem as well, even if you only have one version of React.
https://www.npmjs.com/package/gulp-browserify didn't have this problem. Once I stopped using gulp-browserify and switched to watchify+browserify, Uncaught TypeError: Cannot read property 'firstChild' of undefined
started happening.