1

error while importing:

import { DataTable } from 'react-jquery-datatables';

terminal error:

ERROR in ./node_modules/react-jquery-datatables/node_modules/react-
dom/server.js
Module not found: Error: Can't resolve 'react/lib/ReactDOMServer' in 
'/home/laith/workspace/mender-dashboard/node_modules/reac
t-jquery-datatables/node_modules/react-dom'
@ ./node_modules/react-jquery-datatables/node_modules/react-
dom/server.js 
3:17-52
@ ./node_modules/react-jquery-datatables/lib/Table.js
@ ./node_modules/react-jquery-datatables/lib/index.js
@ ./src/views/User/User.js
@ ./src/containers/Full/Full.js
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 
webpack/hot/dev-server ./src/index.js

tried to reinstall react-jquery-datatables and react-dom nothing happens

6
  • what you used to install react-dom? Commented Oct 25, 2017 at 11:12
  • @MayankShukla npm install react-dom --save-dev Commented Oct 25, 2017 at 11:15
  • check package.json file, if it was installed correctly you will find an entry here. Like this: react-dom: version no or hit npm list react-dom it will print the version. Commented Oct 25, 2017 at 11:20
  • npm list react-dom └─┬ [email protected] └── [email protected] at package.json file - devDependencies "react-dom": "^16.0.0", Commented Oct 25, 2017 at 11:24
  • Try with removing the curly brackets around the DataTable. Do this: import DataTable from 'react-jquery-datatables' Commented Oct 25, 2017 at 13:27

3 Answers 3

3

Worked for me by simply uninstalling and resintalling. run below command.

npm uninstall react-dom a 

and than

  npm install react-dom --save-dev 
2

I think it is related to this issue. react/lib/ReactDOMServer is replaced by react-dom/server. So try downgrading react to 0.14. Make react-dom as a dependency, not as dev dependency, and ensure NODE_ENV is not set to production.

npm i [email protected] --save 
0
1

install both react and react dom, because react-dom needs react

npm i react

npm i react-dom

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.