Mirko Flyktman
Mirko Flyktman

Reputation: 266

Importing react-bootstrap modal crashes react app

I am getting the following errors when trying to import react-bootstrap Modal component into my react project:

ERROR in ./~/react-dom/lib/ReactDOMUnknownPropertyHook.js
Module not found: Error: Cannot resolve module 'react/lib/ReactComponentTreeHook' in /vagrant/node_modules/react-dom/lib
 @ ./~/react-dom/lib/ReactDOMUnknownPropertyHook.js 15:29-72

ERROR in ./~/react-dom/lib/ReactDOMNullInputValuePropHook.js
Module not found: Error: Cannot resolve module 'react/lib/ReactComponentTreeHook' in /vagrant/node_modules/react-dom/lib
 @ ./~/react-dom/lib/ReactDOMNullInputValuePropHook.js 13:29-72

ERROR in ./~/react-dom/lib/ReactDOMInvalidARIAHook.js
Module not found: Error: Cannot resolve module 'react/lib/ReactComponentTreeHook' in /vagrant/node_modules/react-dom/lib
 @ ./~/react-dom/lib/ReactDOMInvalidARIAHook.js 14:29-72

ERROR in ./~/react-dom/lib/instantiateReactComponent.js
Module not found: Error: Cannot resolve module 'react/lib/getNextDebugID' in /vagrant/node_modules/react-dom/lib
 @ ./~/react-dom/lib/instantiateReactComponent.js 20:21-56

ERROR in ./~/react-dom/lib/ReactDebugTool.js
Module not found: Error: Cannot resolve module 'react/lib/ReactComponentTreeHook' in /vagrant/node_modules/react-dom/lib
 @ ./~/react-dom/lib/ReactDebugTool.js 16:29-72

ERROR in ./~/react-dom/lib/ReactChildReconciler.js
Module not found: Error: Cannot resolve module 'react/lib/ReactComponentTreeHook' in /vagrant/node_modules/react-dom/lib
 @ ./~/react-dom/lib/ReactChildReconciler.js 29:27-70 37:31-74

ERROR in ./~/react-dom/lib/flattenChildren.js
Module not found: Error: Cannot resolve module 'react/lib/ReactComponentTreeHook' in /vagrant/node_modules/react-dom/lib
 @ ./~/react-dom/lib/flattenChildren.js 26:27-70 42:33-76

ERROR in ./~/react-dom/lib/checkReactTypeSpec.js
Module not found: Error: Cannot resolve module 'react/lib/ReactComponentTreeHook' in /vagrant/node_modules/react-dom/lib
 @ ./~/react-dom/lib/checkReactTypeSpec.js 29:27-70 71:37-80

When I remove the line where I am importing the Modal from react-bootstrap everything works just fine.

My react versions in package.json are the following:

"react": "^0.13.3", "react-bootstrap": "^0.31.0", "react-dom": "^15.5.4",

Upvotes: 3

Views: 995

Answers (2)

Piyush
Piyush

Reputation: 1193

https://www.npmjs.com/package/react-modal

Better use this library, this is a very nice library as i had personally used this and works fine. If it works for you don't forget to accept and upvote

Upvotes: 0

Shubham Khatri
Shubham Khatri

Reputation: 281646

You React and ReactDOM versions are not compatible with react-bootstrap versions, you need to update the respective packages to their latest versions since your ReactDOM is already at the latest

You can upgrade React to 15.5.4 too .

However you may face issues with the changes that have been made in the latest React versions, and I recommend you to folow the latest protocols since the support for the legacy one will be stopped in later releases.

However if you still want to use the old ways, you can upgrade react and react-dom to using v15.1.0 for example

Upvotes: 1

Related Questions