Chartjs-Chart js + typescript leading to Can't resolve 'react-server-dom-webpack'

0👍

Below are the possibilities,

  • Try with downgrade chartjs version to 3.x.x
  • Install types also like @types/react-server-dom-webpack
  • Do npm i properly if any of module pending

0👍

I will assume you are using the relatively latest node version and npm version. Otherwise, edit your question and let us know what versions are you using and on which OS.

Based on my assumptions: since you have commented out the line: Import useClient from react-server-dom-webpack

That is the reason why you are getting this error. The npm can not find this module you have commented out. I suggest you do the below:

  1. Remove your node modules folder then install npm packages again
  2. After that, re-install the dependency by running: npm install react-dom react
  3. Run your code npm run start

Leave a comment