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

"TypeError: Cannot read property 'type' of undefined" when clicking "Go to about page via redux" #1

Closed
joncass opened this issue May 22, 2017 · 4 comments
Labels

Comments

@joncass
Copy link

joncass commented May 22, 2017

Hello -

I like the setup of your project a lot and found your Medium post very useful, so thanks!

When I clone this repo and start it, I am having the issue from the title:
"TypeError: Cannot read property 'type' of undefined"
when I click the "Go to about page via redux".

Based on this commit on cyberid41's fork, they seem to have the issue too.

Some googling led me to this issue on the react-router-redux page, where it was indicated there might be a problem with the ordering of the middleware, but it looks right to me (thunk first).

Anyway, you obviously don't owe me anything but I figured you might want to know and if you do happen to have a solution I'd love to see it :). Also, I'm very new to open source and github, so apologies if this is an incorrect or inappropriate way to file an issue. Thanks for reading!

@notrab
Copy link
Owner

notrab commented May 23, 2017

Hey @joncass

This is the perfect place for these kind of issues. So don't worry! I'm new to OSS too, so we're all learning 😀

I'll have a look into the issue and get back to you shortly. Sorry about the inconvenience!

@notrab notrab added the bug label May 23, 2017
@patientplatypus
Copy link

I as well had the same issue (error page screenshot http://imgur.com/a/OxAxI). I would also like to note that you're code and the code on the tutorial I followed were different (and I assumed that the github was more up to date). FYI. Thanks for posting the tutorials.

@notrab
Copy link
Owner

notrab commented May 27, 2017

Hey @patientplatypus

Thanks for the feedback, I'll update the Medium post this weekend and change the way the dispatch is used for changing routes.

Have a great weekend!

@notrab
Copy link
Owner

notrab commented May 28, 2017

Ok so the problem with this is the use of bindActionCreators.

When I first made the tutorial I wasn't use this and I dropped it in last minute so it's failing due to calling dispatch on something that is already mapped to a dispatch.

Inside src/containers/home you'll want to change changePage function to be....

changePage: () => push('/about-us')

I'll update the tutorial + repo next.

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

No branches or pull requests

3 participants