erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
12k stars 2.5k forks source link

React version 15 breaking changes; `15.0.0-rc.2` causes error in /bin/server.js #1033

Closed kulicuu closed 8 years ago

kulicuu commented 8 years ago

Tested with 0.15.0-alpha.1 works. 15.0.0-rc.1 fails like 15.0.0-rc.2. Btw I'm changing react and react-dom dependencies simultaneously.

On npm run-script dev I get:

[2] ==> 🌎  API is running on port 3030
[2] ==> 💻  Send requests to http://localhost:3030
[1] [piping] can't execute file: /home/wylie/kikar_rabin/rRUHE_mod_000/bin/server.js
[1] [piping] error given was: TypeError: Cannot read property 'propTypes' of undefined
[1]     at Object.uncontrollable [as default] (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/uncontrollable/createUncontrollable.js:31:49)
[1]     at Object.<anonymous> (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/react-bootstrap/lib/Navbar.js:220:141)
[1]     at Module._compile (module.js:413:34)
[1]     at Module._extensions..js (module.js:422:10)
[1]     at require.extensions.(anonymous function) (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babel-register/lib/node.js:134:7)
[1]     at Object._module3.default._extensions.(anonymous function) [as .js] (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:250:71)
[1]     at Module.load (module.js:357:32)
[1]     at Module._load (module.js:314:12)
[1]     at Function.module._load (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/piping/lib/launcher.js:32:16)
[1]     at Module.require (module.js:367:17)
[1] [piping] further repeats of this error will be suppressed...
[1] [piping] can't execute file: /home/wylie/kikar_rabin/rRUHE_mod_000/bin/server.js
[1] [piping] error given was: SyntaxError: /home/wylie/kikar_rabin/rRUHE_mod_000/bin/server.js: 'return' outside of function (18:4)
[1]   16 |       ignore: /(\/\.|~$|\.json|\.scss$)/i
[1]   17 |     })) {
[1] > 18 |     return;
[1]      |     ^
[1]   19 |   }
[1]   20 | }
[1]   21 | 
[1]     at Parser.pp.raise (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:1378:13)
[1]     at Parser.pp.parseReturnStatement (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:2018:10)
[1]     at Parser.pp.parseStatement (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:1818:19)
[1]     at Parser.parseStatement (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:3507:22)
[1]     at Parser.pp.parseBlockBody (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:2208:21)
[1]     at Parser.pp.parseBlock (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:2189:8)
[1]     at Parser.pp.parseStatement (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:1838:19)
[1]     at Parser.parseStatement (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:3507:22)
[1]     at Parser.pp.parseIfStatement (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:2011:26)
[1]     at Parser.pp.parseStatement (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/babylon/index.js:1816:19)
[1] [piping] further repeats of this error will be suppressed...
[1] (node) warning: possible EventEmitter memory leak detected. 11 disconnect listeners added. Use emitter.setMaxListeners() to increase limit.
[1] Trace
[1]     at process.addListener (events.js:252:17)
[1]     at process.once (events.js:278:8)
[1]     at Worker.destroy (cluster.js:678:13)
[1]     at Worker.__dirname.Worker.options.process.on.Worker.kill (cluster.js:47:16)
[1]     at process.<anonymous> (/home/wylie/kikar_rabin/rRUHE_mod_000/node_modules/piping/lib/launcher.js:49:27)
[1]     at emitOne (events.js:90:13)
[1]     at process.emit (events.js:182:7)
[1]     at process._fatalException (node.js:258:26)
[0] Hash: 9d7d1687f74a2bba5a9f
[0] Version: webpack 1.12.14
[0] Time: 18511ms

npm install had complained about unmet dependencies,

react-redux-universal-hot-example@0.9.0 /home/wylie/kikar_rabin/rRUHE_mod_000
├─┬ UNMET PEER DEPENDENCY react@15.0.0-rc.2
│ └─┬ fbjs@0.8.0-alpha.3 
│   └─┬ isomorphic-fetch@2.2.1 
│     ├─┬ node-fetch@1.3.3 
│     │ └── encoding@0.1.12 
│     └── whatwg-fetch@0.11.0 
└── UNMET PEER DEPENDENCY react-dom@15.0.0-rc.2
gabriel-miranda commented 8 years ago

This is due bootstrap and not server error in: /node_modules/react-bootstrap/lib/Navbar.js:220:141 react-bootstrap is not supporting react 15 until stable release, you can try to do use this https://www.npmjs.com/package/react-bootstrap-15 close this please

kulicuu commented 8 years ago

Thankyou , ... , works beautifully after changing the import invocation in /src/app/App.js. Thanks !