-
Notifications
You must be signed in to change notification settings - Fork 34
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
Cannot read properties of undefined (reading 'pathname') #83
Comments
Hi there @reZach 1.) remove "connected-react-router": "^6.9.2", lmk! |
Thanks @salvoravida , I tried these suggestions (and updated that repo) yet I still see the same issue. Do you have another suggestion? |
@salvoravida, |
no you do not need to install history5, it is already a dep of react-router v6. Anyway your project is corrupted. Here is a test project with your code, that works. https://codesandbox.io/s/rfh-issue-test-ephnte Best regards. |
Also had such a problem. Tried with history 4.10.* and history 5.3.0. And tried to remove history dep from the project. Worked solution for me is to install history 5.0.0. |
Hello, thank you for this repo! I was directed here based on your comment of using redux-first-history instead of connected-react-router. I wanted to ask, because I feel like I'm following your instructions properly, but I'm running into a strange error. Here is what I have. Everything is pretty much boilerplate from what's in the README:
store.js (with @reduxjs/toolkit)
app.js (react-router v6)
routes.jsx
welcome.jsx
about.jsx
My app loads fine, but as soon as I try to navigate to another page I get this error
Cannot read properties of undefined (reading 'pathname')
. I can't figure out if this is an error in redux-first-history or somewhere else. This comment makes me feel like<HistoryRouter>
needs to support something like this (but I'm not entirely sure).Can you point me in the right direction?
repro steps
I made a small POC repo where this can be replicated
https://github.com/reZach/react-router-v6-upgrade
The text was updated successfully, but these errors were encountered: