-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Uncaught TypeError: this.unsubscribe is not a function #28
Comments
I believe this has to do w/ some incorrect stuff that was happening in the app, though I don't know exactly what yet. This may be something that should never normally happen. |
Ok, so here's what we were doing... in |
OK I introduced this bug while tweaking @gnoff's code. :-( |
Can you verify the bug is fixed in |
yep, it is. But then I get this:
which makes me think we're doing something very wrong. By removing the What's the right way to fire an action when a component mounts? If the action immediately modifies state, |
I found this: facebook/react#4233. Sounds like React throws if you use
What do you mean by "too soon"? If React Redux doesn't update in some edge case, it's a bug, no matter where you call |
I just assume that you've thought of everything and there's a good reason it is as it is! I'll make sure it is what I think it is and file an issue when I get a sec. Thanks! |
Keeping it open for now so I don't forget about it. |
Ideally, the fastest way to figure out a solution is to discuss a failing test. Can I ask you to contribute it? |
Looks like you beat me to it! feel free to close #31, thanks. Btw, is there a reason to do it this way instead of by subscribing in |
Yes, |
The second error I saw is actually this: facebook/react#2410 I'm not sure why yet, in my case, it has to do w/ clicking submit on a form triggering a router transition. I'll keep digging |
If you can reliably reproduce it on a small project let the folks know. It could be a React bug after all. Are you by chance using React.addons.batchedUpdates or similar? Not saying I understand the issue but if so, try removing it and check if it makes the bug go away. I've heard about problems with batching and inputs although not sure what kind. Sorry if this is too vague. :-) |
We are, but removing it has no effect. I'll work on a small repro. |
You may be following that thread, so you may have seen it, but here's a repro: https://github.com/aaronjensen/react-2410-repro The error does not happen if this line is removed: https://github.com/aaronjensen/react-2410-repro/blob/master/app/create_router.jsx#L10 |
Occasionally, when clicking through our app we get this:
Is it possible for will unmount to fire before mount? Should we check to ensure
unsubscribe
is there before calling it or is something else going on?The text was updated successfully, but these errors were encountered: