Closed ywen closed 9 years ago
Hi @ywen, i'm not sure, but i think it may help you: https://github.com/webpack/react-starter/issues/37#issuecomment-104304128
By removing a unnecessary node-fetch
import the problem is fixed. Thanks for your help!
because server can not find window, you can use this
getInitialState() { return {windowWidth: (typeof window !== 'undefined')? window.innerWidth:undefined}; },
Hi,
I use node-fetch in a reacts + rails project. I use https://github.com/shakacode/react_on_rails to glue between reactjs and Rails. Everything works fine except when I do server side rendering it complains the error "Encountered error "Error: no window object present" when prerendering".
I am willing to work a PR, just need some directions. Thanks!
The line that raise the error:
https://github.com/substack/http-browserify/blob/master/index.js#L54