Skip to content
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 Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider> #192

Open
kirbyhipona opened this issue Sep 7, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@kirbyhipona
Copy link

kirbyhipona commented Sep 7, 2022

I tried to integrate the Uniswap Widget from the documentation and fix several bugs and errors and still no luck.
I was wondering why I should do the React-Redux. I followed the documentation of the widget. I already tried the Redux but nothing works. Please I need help.

@kirbyhipona kirbyhipona added the bug Something isn't working label Sep 7, 2022
@akarys92
Copy link

@kirbyhipona Can you please clarify steps to reproduce the issue you're seeing?

@luizkc
Copy link

luizkc commented Sep 26, 2022

Having the same issue. Was working fine before, and with no change in the code, receiving the same error with broken component. My widget code looks like this:

import { SwapWidgetProps, SwapWidget } from '@uniswap/widgets';
import '@uniswap/widgets/fonts.css';

export function UniswapWidget(props: SwapWidgetProps) {
  return (
    <div className="Uniswap">
      <SwapWidget width={567} {...props} />
    </div>
  );
}

Error reads:
Screen Shot 2022-09-26 at 5 48 53 PM

Widget rendered like this:
Screen Shot 2022-09-26 at 5 50 28 PM

@kirbyhipona
Copy link
Author

kirbyhipona commented Sep 27, 2022

I solved the problem by downgrading the Uniswap Version. I used "@uniswap/widgets": "2.1.1". Maybe you can use the most updated one. Try to look for the best version of your environment.

@luizkc
Copy link

luizkc commented Sep 27, 2022

I'm using version 2.7.0, the version that last worked for me, but having this issue. Any suggestions for which version to use? @kirbyhipona

@Luknam
Copy link

Luknam commented Sep 27, 2022

I try 2.6.0 and its work

@luizkc
Copy link

luizkc commented Sep 27, 2022

Tried 2.6.0, receiving the same error

@11best
Copy link

11best commented Sep 28, 2022

I try
react : 18.2.0
react-dom : 18.2.0
react-redux : 7.2.9
and @uniswap/widget 2.8.1,
it work fine, probably caused by react-redux version.

@luizkc
Copy link

luizkc commented Sep 28, 2022

Downgraded my react-redux from 8.x.x to 7.2.9 and widget is working as expected. Thanks @11best

@kirbyhipona
Copy link
Author

kirbyhipona commented Oct 11, 2022 via email

@Dashon
Copy link

Dashon commented Feb 25, 2023

I solved this by upgrading my react-redux, i went from 7.2.6 to 8.0.0. Im using "@uniswap/widgets": "^2.40.0"

@marcinciarka
Copy link

No need to downgrade, this is the same issue and can be fixed the same way as here: #404 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants