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

Should react-redux be a peer dependency? #202

Open aneeshvaidya opened 6 years ago

aneeshvaidya commented 6 years ago

I recently upgraded to react-engine 4.4.0, and now I'm seeing an error in my build script where react-redux is not found, due to the redux support addition.

jonathansamines commented 6 years ago

Yes, I am also experienced this issue when updating my react-engine version. Seems like even when the dependency is imported conditionally, webpack is trying to import it and it fails because of it. I wouldn't mind to install the dependency, however some projects don't use redux at all so this solution is not optimal for everyone.

Perhaps is just a matter to change something in my webpack configuration, ideas?

aneeshvaidya commented 6 years ago

I believe this will likely solve the issue: http://remarkablemark.org/blog/2017/02/25/webpack-ignore-module/

clintandrewhall commented 6 years ago

I have this issue with Browserify.

jonathansamines commented 6 years ago

@aneeshvaidya Using webpack.IgnorePlugin worked for us. Thanks!

ashok-kumar commented 6 years ago

Same error with latest version of react-engine.

ERROR in ./~/react-redux/lib/connect/mapDispatchToProps.js
Module not found: Error: Cannot resolve module 'redux' in .../../../node_modules/react-redux/lib/connect
 @ ./~/react-redux/lib/connect/mapDispatchToProps.js 8:13-29

@aneeshvaidya Ignoring module works in this case. Thanks!