Invalid context `storeSubscription` of type `Subscription`...
See original GitHub issueI am seeing the following error in the Chrome dev tools:
Warning: Failed context type: Invalid context `storeSubscription` of type `Subscription` supplied to `Connect(connectForm(Form))`, expected instance of `Subscription`.
The error happens when I @connect
a component that contains another connected component somewhere deeply in the tree. The error is on the nested component, not the parent component. I have tried boiling this down to a minimally reproducible case, but I am having trouble coming up with one. When I remove the @connect
from my top-level component, the error goes away. I haven’t noticed any functional problems.
Any suggestions on creating a reproducible case?
FYI, the following case does not produce the error in the console:
@connect(state => ({
hello: true,
}))
class Outer extends React.Component {
render() {
return <Child><Inner /></Child>;
}
}
class Child extends React.Component {
render() {
return this.props.children;
}
}
@connect(state => ({
hello: true,
}))
class Inner extends React.Component {
render() {
return <span>hello</span>;
}
}
render(<Provider store={store}><Outer /></Provider>, document.body);
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Warning: Failed context type: Invalid context `storeSubscription` of ...
Warning: Failed context type: Invalid context storeSubscription of type Subscription supplied to Connect(GroupsList) , expected instance of Subscription .
Read more >angular - I get Error: Type 'Subscription' is not assignable to ...
ERROR in src/app/patient.service.ts(30,3): error TS2322: Type 'Subscription' is not assignable to type 'Observable'. Property '_isScalar' is ...
Read more >Lightroom iPad App Store subscription error! (Rest... - Adobe ...
I'm in the middle of working and now i can't use lightroom on my ipad.. You're web support it an utter failure -...
Read more >Sell subscriptions | Google Play's billing system
When a user upgrades, downgrades, or resignup from your app before the subscription expires, the old subscription is invalidated, and a new subscription...
Read more >cannot pay my store subscription fee for months i... - The eBay ...
cannot pay my store subscription fee for months i get an error message when I try to pay ... Automated Assistant, type AGENT...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually yes, that is exactly what’s happening. Sorry for the false alarm!
For future reference: React uses the
instanceof
operator to check the type ofStoreSubscription
. Since I had two copies of React Redux loading, the left side of theinstanceof
check was aStoreSubscription
from React Redux A, and the right side of theinstanceof
check was from React Redux B. Whoops!Happened to me today after upgrading
react-redux
. Seems to be caused by hot reloading. Simply restartingwebpack-dev-server
solved the issue.