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
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
Share Improve this question asked Oct 25, 2017 at 11:11 Laith YounesLaith Younes 111 gold badge1 silver badge2 bronze badges 6-
what you used to install
react-dom
? – Mayank Shukla Commented Oct 25, 2017 at 11:12 - @MayankShukla npm install react-dom --save-dev – Laith Younes 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 hitnpm list react-dom
it will print the version. – Mayank Shukla 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", – Laith Younes Commented Oct 25, 2017 at 11:24
-
Try with removing the curly brackets around the
DataTable
. Do this:import DataTable from 'react-jquery-datatables'
– Arslan Tariq Commented Oct 25, 2017 at 13:27
3 Answers
Reset to default 3Worked for me by simply uninstalling and resintalling. run below mand.
npm uninstall react-dom a
and than
npm install react-dom --save-dev
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
install both react and react dom, because react-dom needs react
npm i react
npm i react-dom