Build to production fails with ReferenceError: window is not defined
Expected Behavior
Node.js server starts in prod mode after running npm start
Actual Behavior
ReferenceError: window is not defined
Error is referencing compiled file at public/assets/server.js
Steps to Reproduce
npm install
npm run build
npm start
Oddly enough, this was working earlier today just fine, it was when I tried to re-install the repo on another machine that it began to fail. Then trying to re-install it on my original machine it began throwing this error.
Some more error details:
npm ERR! Linux 4.4.23-31.54.amzn1.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.0.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `cross-env NODE_ENV=production node compiled/index.js`
npm ERR! Exit status 1
I ran into this issue too and tracked the error back to redux-logger. It looks like there's an open PR addressing this.
The PR above has been merged and after running npm update redux-logger on a fresh clone, it's working in my machine.
Looks good! I think it can be closed since that's been resolved.
Most helpful comment
I ran into this issue too and tracked the error back to redux-logger. It looks like there's an open PR addressing this.