React version mismatch error
Unanswered
Pixiebob posted this in #help-forum
PixiebobOP
I am new to using Next, and wanted to test I library(https://www.npmjs.com/package/@undp/data-viz) I build with next but when I use it with next it give me React version mismatch error. The issue is I am only using React 19.1.0 in my library (git repo: https://github.com/undp/data-visualization). When I try to use it it gives an error:
Error: Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
- react: 19.2.0-canary-3fbfb9ba-20250409
- react-dom: 19.1.0
I have tried checking for the canary version of react in the library but I cannot find it anywhere therefore cannot resolve this issue. when I try
I have created a git repo of library with Next: https://github.com/mustafasaifee42/my-next-app
I would appreciate any help on this as I have been stuck on this for a couple of days and am out of ideas.
Thanks
Error: Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
- react: 19.2.0-canary-3fbfb9ba-20250409
- react-dom: 19.1.0
I have tried checking for the canary version of react in the library but I cannot find it anywhere therefore cannot resolve this issue. when I try
npm ls react
i only see 19.1.0
. I works when I use it with a next ap without App router.I have created a git repo of library with Next: https://github.com/mustafasaifee42/my-next-app
I would appreciate any help on this as I have been stuck on this for a couple of days and am out of ideas.
Thanks