paypal / react-engine

a composite render engine for universal (isomorphic) express apps to render both plain react views and react-router views
Apache License 2.0
1.45k stars 130 forks source link

Unable to require `react-engine` unless `react-router` is installed #151

Closed remarkablemark closed 8 years ago

remarkablemark commented 8 years ago

In the README it says that react-router is optional, but it may not seem to be the case:

$ node
> require('react-engine');
Error: Cannot find module 'react-router' from parent
    at module.exports (./node_modules/parent-require/index.js:8:9)
    at Object.safeRequire (./node_modules/react-engine/lib/util.js:65:14)
    at Object.<anonymous> (./node_modules/react-engine/lib/server.js:34:19)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (./node_modules/react-engine/index.js:18:18)

I fixed this in my local project by installing react-router. I just wanted to check if this is intended behavior.

samsel commented 8 years ago

v3.2.2 has the fix to make react-router really optional. give it a try @remarkablemark

remarkablemark commented 8 years ago

Got it. Thanks @samsel!