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

Parent require error when requiring react-engine #118

Closed 88kami88 closed 8 years ago

88kami88 commented 8 years ago

var client = require('react-engine').client;

Using browserify to bundle client side and run in the browser I get this error:

Cannot find module 'express/lib/view' from parent from https://github.com/paypal/react-engine/blob/9000adad4b7ea694b6aa6155fdef2cbe4f134a53/lib/expressView.js#L24

Any ideas?

88kami88 commented 8 years ago

Think I solved it with browserify's require option: -r express/lib/view

samsel commented 8 years ago

@ethersage you can import like below to avoid inclusion of unwanted files. var ReactEngineClient = require('react-engine/lib/client');