#help
1 messages · Page 1 of 1 (latest)
This issue is related to a dependency conflict in Next.js 15 projects using React 19 RC (Release Candidate). The problem occurs because Next.js 15 uses a pre-release version of React 19, which is not compatible with many third-party packages that expect React 16, 17, or 18.
There are a few workarounds you can try:
-
Use the
--legacy-peer-depsflag when installing packages:npm install --legacy-peer-depsHowever, this may lead to potential issues as noted in Github Issue #72026 (https://github.com/vercel/next.js/issues/72026).
-
Add an override in your
package.jsonfile:"overrides": { "react": "$react", "react-dom": "$react-dom" }This solution was suggested in Github Issue #72026 (https://github.com/vercel/next.js/issues/72026) and might be safer than using
--forceor--legacy-peer-deps. -
Downgrade React to version 18, which is compatible with more packages.
It's worth noting that this is a known issue affecting many Next.js 15 users trying to install various packages. The Next.js team is aware of the problem, but a definitive solution hasn't been implemented yet.