-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Error: Could not find router reducer in state tree, it must be mounted under "router" - React-Admin doesn't work with history@5.0.0 #5450
Comments
I'm having the same problem. |
Thanks @altenorjr :) |
I'd love to be able to detect the version of history passed to react-admin, and throw an explicit warning if it's a 5.0, but unfortunately I didn't find anything in the history public API allowing for that. If anyone knows a way, please chime in! I'm reopening this issue as it's something that will bite more devs. |
@fzaninotto I think while it isn't fixed, this info could be be included in the docs, under the history prop section in the component docs. Apart from actually fixing it, I guess maybe setting the |
I am facing this same errror message in a project running yarn 3 in pnp mode. I am not even using history directly. I have storybook in the same workspace that uses a history >5, but that shouldn't really affect anything as yarn should be isolating the subdependencies, right?
Any idea what the source could be and how to fix it? |
I'm not sure if I should be posting this here, but after couple hours of headache I found the solution, so I'm here only to share, as it is probably happening to a lot of people.
As mentioned in https://marmelab.com/react-admin/Admin.html#history, I tried to use the snippet
I installed the
history
module and then began receiving the following error message:Could not find router reducer in state tree, it must be mounted under "router"
.I eventually stumbled upon this thread and found a life-saving suggestion
supasate/connected-react-router#312
I did as he suggested and my App came back to life.
I didn't have time to dig too deep into it, but for what I realized, there's probably a mismatch between the versions of react-router-dom and the history module. But I have zero confidence that's really the case.
So I really don't know what to do with the information.
I'm using the latest and greatest version (3.9.5) of react-admin, of which I'm becoming an evangelist. (Nice work, guys!). The project was created just two days ago. I've have been using RA for the last year with never having a single problem up until now.
The text was updated successfully, but these errors were encountered: