hasanayan / craco-plugin-react-hot-reload

Adds the react-hot-loader to your create-react-app via craco
20 stars 2 forks source link

Issue with craco-antd: Can't resolve react-dom in /node_modules/antd/lib/_util #7

Open marcosfede opened 4 years ago

marcosfede commented 4 years ago

Using this plugin in addition to craco-antd throws: Module not found: Can't resolve 'react-dom' in /node_modules/antd/lib/_util'

EthanDM commented 4 years ago

To fix this:

  1. npm install @hot-loader/react-dom

  2. Add webpack config alias 'react-dom': '@hot-loader/react-dom'

See here: https://github.com/gaearon/react-hot-loader#hot-loaderreact-dom