Reputation: 48
I have tried yarn add react react-dom but still facing these issues.If anyone can help me with this
index.js:1437 D:/ecodocs-admin/node_modules/rc-align/es/Align.js
Module not found: Can't resolve 'react-dom' in 'D:\ecodocs-admin\node_modules\rc-align\es'
console.<computed> @ index.js:1437
index.js:1437 D:/ecodocs-admin/node_modules/rc-animate/es/AnimateChild.js
Module not found: Can't resolve 'react-dom' in 'D:\ecodocs-admin\node_modules\rc-animate\es'
console.<computed> @ index.js:1437
index.js:1437 D:/ecodocs-admin/node_modules/rc-time-picker/es/Select.js
Module not found: Can't resolve 'react-dom' in 'D:\ecodocs-admin\node_modules\rc-time-picker\es'
console.<computed> @ index.js:1437
index.js:1437 D:/ecodocs-admin/node_modules/rc-trigger/es/index.js
Module not found: Can't resolve 'react-dom' in 'D:\ecodocs-admin\node_modules\rc-trigger\es'
console.<computed> @ index.js:1437
index.js:1437 D:/ecodocs-admin/node_modules/rc-trigger/es/Popup.js
Module not found: Can't resolve 'react-dom' in 'D:\ecodocs-admin\node_modules\rc-trigger\es'
console.<computed> @ index.js:1437
index.js:1437 D:/ecodocs-admin/node_modules/rc-util/es/Portal.js
Module not found: Can't resolve 'react-dom' in 'D:\ecodocs-admin\node_modules\rc-util\es'
console.<computed> @ index.js:1437
index.js:1437 D:/ecodocs-admin/node_modules/rc-util/es/ContainerRender.js
Module not found: Can't resolve 'react-dom' in 'D:\ecodocs-admin\node_modules\rc-util\es'
console.<computed> @ index.js:1437
index.js:1437 D:/ecodocs-admin/node_modules/rc-util/es/Dom/addEventListener.js
Module not found: Can't resolve 'react-dom' in 'D:\ecodocs-admin\node_modules\rc-util\es\Dom'
Upvotes: 1
Views: 4515
Reputation: 51
I think in many cases people will already have react-dom. If so, based on the comments, I think it is worth checking if you have added @hot-loader/react-dom as an alias, but forgot to install it. In such cases you need to do:
npm install -D @hot-loader/react-dom
Upvotes: 1
Reputation: 461
Use this to install react and react-dom:
yarn add react react-dom
If this not work, you You have to fix the 'externals' configuration in webpack.config :
externals: {
'react': 'react',
'react-dom': 'react-dom'
}
Upvotes: 4