enzymejs / enzyme

JavaScript Testing utilities for React
https://enzymejs.github.io/enzyme/
MIT License
19.96k stars 2.01k forks source link

Issue after upgrading to React 15 #302

Closed toddw closed 8 years ago

toddw commented 8 years ago

After upgrading to React 15, I started getting the following error with enzyme.

ERROR in ./~/enzyme/build/react-compat.js
Module not found: Error: Cannot resolve module 'react/addons' in /projects/test/node_modules/enzyme/build
 @ ./~/enzyme/build/react-compat.js 37:16-39
FezVrasta commented 7 years ago

peerDependencies will throw a warning when not installed, but they don't prevent npm from work.

Do you think that, to support an ancient version of React, you should expose all your users to this kind of behavior? Why don't you put it in the dependencies and let 0.13 users install it even if they will not use it?

ljharb commented 7 years ago

yes, this is the proper way to do it for the time being. We have a plan to alter the core of enzyme in the future such that this problem won't occur again, but in the meantime, the current behavior will not be changing.

diegoool commented 6 years ago

Error: Cannot resolve module 'enzyme/build/react-compat' I fixed that when i did npm install into the /node_modules/chai-enzyme/