Can't Build and Run
greygatch opened this issue · comments
Have to upgrade React and React Dom to 16.8, but then when you try to build and run the project, you get the following error:
Invariant Violation: Could not find "store" in the context of "Connect(WithStyles)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(WithStyles) in connect options.
Everything works perfectly in dev mode.
Would you have more details about the error or link for playback? I did the whole process and had no problems with React 16.8.
Here's the issue in detail: reduxjs/react-redux#1319
When I run the "with-redux" example in the next.js project, I am able to build and run just fine. Not sure what the disconnect is.
On node v10.16.0
It appears that downgrading the react-redux package solved this issue for me.
"react-redux": "6.0.0"
to
"react-redux": "^5.0.1"
This is because the newer versions of redux are built differently and implemented differently.
You can see more details here.