glenjamin / skin-deep

Test assertion helpers for use with React's shallowRender test utils
MIT License
200 stars 40 forks source link

Module not found: Error: Cannot resolve module 'react/addons' in /apps/node_modules/skin-deep #73

Closed cbrwizard closed 8 years ago

cbrwizard commented 8 years ago

Hey, after updating React to 15.0.1 I started receiving this error when compiling with Webpack:

Module not found: Error: Cannot resolve module 'react/addons' in /apps/node_modules/skin-deep
 @ ./~/skin-deep/skin-deep.js 8:14-37

I use skin-deep@0.16.0. I didn't receive this error before updating React. This must be linked to this recent change. Are there any plans to update this package for React 15? Thanks!

glenjamin commented 8 years ago

Sounds like you'll need to update the bundling config you have to also exclude "react/addons" - the if statement inside the code will ensure that require will never be called.

I'll get the docs updated and bump package.json soonish.

glenjamin commented 8 years ago

I have confirmed that the current version appears to work fine with React 0.15.

I've updated the bundle exclusion docs and included 0.15 in the test suite in https://github.com/glenjamin/skin-deep/commit/84325b12853e2c4d7cdcd6ff202c7b5d8ebd90dc

glenjamin commented 8 years ago

Feel free to re-open if you still have issues after updating your exclude config.

cbrwizard commented 8 years ago

Hey @glenjamin thanks for the swift response! Changing to

new webpack.IgnorePlugin(/ReactContext|react\/addons/)

resolved this error without the need to update skin-deep. Thank you!