Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@reduxjs/toolkit is not compatible with the official React 19 release #4759

Closed
JesusVergara89 opened this issue Dec 9, 2024 · 3 comments
Closed

Comments

@JesusVergara89
Copy link

Hello,

I encountered an issue while attempting to use @reduxjs/toolkit with the newly released React 19. The installation fails due to peer dependency conflicts, as @reduxjs/toolkit currently specifies compatibility only with React versions ^16.9.0, ^17.0.0, or ^18.

Here is the error message:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @reduxjs/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! peer react@"^19.0.0" from [email protected]
npm ERR! node_modules/react-dom
npm ERR! react-dom@"^19.0.0" from the root project
npm ERR! peer react@">= 16" from [email protected]
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"5.0.1" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional react@"^16.9.0 || ^17.0.0 || ^18" from @reduxjs/[email protected]
npm ERR! node_modules/@reduxjs/toolkit
npm ERR! @reduxjs/toolkit@"" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR! peerOptional react@"^16.9.0 || ^17.0.0 || ^18" from @reduxjs/[email protected]
npm ERR! node_modules/@reduxjs/toolkit
npm ERR! @reduxjs/toolkit@"
" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/jesusvergara/.npm/_logs/2024-12-09T20_41_42_736Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/jesusvergara/.npm/_logs/2024-12-09T20_41_42_736Z-debug-0.log

@JesusVergara89
Copy link
Author

To work around the incompatibility between @reduxjs/toolkit and React 19, I needed to downgrade React to the latest compatible version (React 18)

  • npm uninstall react react-dom
  • npm install react@18 react-dom@18
  • npm install @reduxjs/toolkit

@markerikson
Copy link
Collaborator

We've got an open PR at #4409 and should have an updated release out soon.

@markerikson
Copy link
Collaborator

Out in https://github.com/reduxjs/redux-toolkit/releases/tag/v2.5.0 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants