Store not found in redux example. Example does not work
briziel opened this issue · 11 comments
Hi,
Thank you for your awesome work. Found is great. But there is a problem with the the redux example (https://github.com/4Catalyzer/found/tree/master/examples/redux). It does not start. When i run yarn start, localhost:3000 opens in the Browser and there is the following error: "Could not find "store" in the context of "ConnectedRouter". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to ConnectedRouter in connect options."
I have the same error in my application since i updated found and redux respectively. I just want to run the example that i have a working blueprint.
Maybe there is a easy solution for this error.
My Setup:
MacBook Pro
OSX Mojave 10.14.6 (18G95)
node -v v8.11.4
npm -v 6.11.3
yarn -v 1.15.2
best regards
Fabricius
Are you running the version of the example on master right now?
Most likely what's happening is that you have duplicate versions of react-redux
installed. Can you run yarn why react-redux
, and then eliminate the duplicate versions if so?
Hey, yes i was running the master version. I used yarn why react-redux
:
[1/4] 🤔 Why do we have the module "react-redux"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "react-redux@6.0.1"
info Has been hoisted to "react-redux"
info Reasons this module exists
- Specified in "dependencies"
- Hoisted from "found#react-redux"
info Disk size without dependencies: "384KB"
info Disk size with unique dependencies: "1.28MB"
info Disk size with transitive dependencies: "1.36MB"
info Number of shared dependencies: 9
✨ Done in 0.66s.
Maybe i am wrong, but this looks fine to me. I tried npm dedupe
aswell, unfortunately with above-mentioned result.
Can you try this against a fresh clone of the repo?
If I do:
$ hub clone 4Catalyzer/found
$ cd examples/redux
$ yarn && yarn start
I get a working example page.
Hi, thought I'd chime in as well. First off, I love found. We're currently using the found and farce packages in our react plus redux project (found v.0.3.21 and farce v0.2.6), and it works like a dream.
I recently tried updating both packages and ran into this issue (Cannot find "store" in the context of "ConnectedRouter".
). Found this issue and tried running this example against a fresh clone of the repo as suggested by @taion . I get the exact same result as @briziel when attempting to run the example.
I tried updating the example project to found v.0.4.9 and farce to v0.2.8 as well as downgrading react-redux to v5.1.1 to no effect.
My setup:
MaxOS Mojave v10.14.6
node v10.16.0
npm v6.9.0
I updated all the dependencies in the examples in #564. Can you try again? The only meaningful change was https://github.com/4Catalyzer/found/pull/564/files#diff-7b2b83034007ff85c37ed91437658d37R87, which only affects SSR, so I'm not sure what the problem could be. I'm still not personally experiencing this.
If you're upgrading to the newest versions of Found, you'll also want to upgrade react-redux to v7.x. The examples now show this.
Could there be anything going on with using yarn link
here?
Also, @hbilles, in your project, what do you get when you check for installed versions of react-redux
?
@taion , the updated example now appears to work for me.
I tried updating react-redux to v7 in my project and it still didn't work. I created a stripped-down test case which can be found here. The first commit uses the older versions of found v0.3.2.1, redux v4.0.0 and react-redux v5.1.1 and works. The current state of the repo throws the Could not find "store"...
error using found v0.4.9, redux v4.0.4 and react-redux v7.1.1.
As for the installed versions of react-redux
, I get react-redux@7.1.1
Note there is nothing mounted at /
. The path needs to be /requests
to work.
Let me know if this should be made into a separate issue. Thanks!
Okay, it's odd that they're not deduped. For the moment, you can run npm dedupe
to dedupe the requirements, which should fix the transient problem.
Let's keep this issue open for now, though. This is #244, which I initially resolved with #337 but ended up backing out because I wasn't sure it was necessary.
Gotcha. Did that and the error went away. However, the path /requests
now returns Not Found
whereas it used to match previously.
This was one of the breaking changes in v0.4.0: https://github.com/4Catalyzer/found/releases/tag/v0.4.0
You need to add a child like
children: [
{},
{
path: 'payment/:id',
Component: PaymentDetail,
},
{
path: 'request/:id',
Component: RequestDetail,
},
],
We made "stem" routes no longer match on their own, because it was somewhat too error-prone.
Yup, that's what it was. Missed that detail. Works like a charm now, thanks!