-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Webpack tries to bundle react-addons-test-utils when it is not needed #968
Copy link
Copy link
Closed
Description
I use the newest version of enzyme, react-dom and react-test-renderer and I shouldn't need react-addons-test-utils anymore. But it looks like enzyme still requires react-addons-test-utils in webpack projects.
ERROR in ./~/enzyme/build/react-compat.js
Module not found: Error: Can't resolve 'react-addons-test-utils' in '/Users/foo/bar/node_modules/enzyme/build'
@ ./~/enzyme/build/react-compat.js 143:20-54
I think it comes from this try/catch-block. It looks like requireing react-dom/test-utils and/or react-test-renderer/shallow fail while bundling (or: they are bundled at build time and something fails inside this try/catch at runtime), so it tries to get react-addons-test-utils. Or does webpack try to bundled things inside a catch by default?
A special handling for react-addons-test-utils in webpack projects currently isn't mentioned in the docs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels