GithubHelp home page GithubHelp logo

Error instantiating router about react-pages HOT 5 CLOSED

rcambrj avatar rcambrj commented on June 25, 2024
Error instantiating router

from react-pages.

Comments (5)

catamphetamine avatar catamphetamine commented on June 25, 2024 1

Ok.
Thanks for the fix in the readme.

from react-pages.

catamphetamine avatar catamphetamine commented on June 25, 2024

Could not find "store" in either the context or props of "ConnectedRouter". Either wrap the root component in a , or explicitly pass "store" as a prop to "ConnectedRouter".

Yes, the default container is this one:

https://github.com/catamphetamine/react-website/blob/2ea5a6f59077c01c32e1af0ff9fe030b1322d142/source/redux/normalize.js#L27-L36

So, seems like you're providing your own container and you have <Provider/> there with the store so theoretically it would work.

I guess the issue is there:

node_modules/found/node_modules/react-redux

So, found has a bug when it has react-redux added in its dependencies instead of making it a peerDependency.
This results in found connect()-ing to a different context and waiting for a <Provider store/> in that context but the <Provider/> that's instantiated in container is from a different node_module so it is therefore in an entirely different context and so found throws an error that <Provider store/> is not found in found's context.

I posted a bug report in found repo:
4Catalyzer/found#244

from react-pages.

catamphetamine avatar catamphetamine commented on June 25, 2024

@rcambrj As a workaround, you could try deleting found/node_modules/react-redux and see if it works.
Or maybe you're using react-redux@6? In that case don't delete found/node_modules/react-redux.
This package has its peerDependency set to 5.x.
https://github.com/catamphetamine/react-website/blob/2ea5a6f59077c01c32e1af0ff9fe030b1322d142/package.json#L48-L53
I guess I should add in the readme that it won't work with react-redux@6.

from react-pages.

rcambrj avatar rcambrj commented on June 25, 2024

@catamphetamine thanks for the quick response, that was indeed the problem, great sleuthing!

setting "react-redux": "^5.1.1" in package.json then yarn install solves the issue. Looks like found are upgrading to [email protected] in their next branch anyway, so might not be a problem for very long.

Thanks again.

from react-pages.

catamphetamine avatar catamphetamine commented on June 25, 2024

FYI:
I'm releasing a new version of this library and also renaming it to react-pages (currently 0.2.3).
It uses the latest found and react-redux now.
Seems to be working for now, I'll be running more tests later and version 1.0.0 will be released after that.

from react-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.