Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

getting "listen is undefined" error when working with redux-router's new history object #173

Closed
mfhholmes opened this issue Jan 7, 2016 · 5 comments

Comments

@mfhholmes
Copy link

it doesn't appear to have a listen method

@mfhholmes
Copy link
Author

apologies, too tired to make much sense. I got it working vaguely by explicitly depending on history and creating a new browserHistory to seed into SyncReduxAndRouter. But it leaves hashes all over the url :(

@kimjoar
Copy link
Collaborator

kimjoar commented Jan 7, 2016

Without a reproducible example we have no way of helping you. Quite a few of us use this already, so without code it's difficult to say what the problem is with your setup.

I'll close this for now, but let's re-open this when you add an example we can look at :)

@kimjoar kimjoar closed this as completed Jan 7, 2016
@mfhholmes
Copy link
Author

my sincere apologies. way too tired to be thinking straight. I had the wrong react-router version, which didn't have a history, and therefore didn't have listen. So easy to resolve once I'd slept ;)

thanks for the awesome work, keep it up :)

@stonecobra
Copy link

I am actually having this problem with [email protected]. Issue is that browserHistory returns undefined on serverside:

https://github.com/rackt/react-router/blob/v2.0.0-rc4/modules/browserHistory.js#L8

So, I assume redux-simple-router should either guard against that, or should I just not load the middleware when server side?

@timdorr
Copy link
Member

timdorr commented Jan 22, 2016

You should pass it a memory history that you create yourself. We also export a createMemoryHistory function that you can use.

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

No branches or pull requests

4 participants