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

[BUG] TypeError: can't access property "store", _useReduxContext is null with UmiJS #408

Closed
stevefrench39 opened this issue May 20, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@stevefrench39
Copy link

stevefrench39 commented May 20, 2021

Describe the bug
We are trying to integrate Frontegg into an Ant Design Pro boilerplate and running into an error when the library is imported. Ant Design Pro uses a plugin system that obscures the root component and makes wrapping it with the Frontegg provider rather circuitous.

You can see our Frontegg plugin below:
https://github.com/Network-Chimp/umi-plugin-access/blob/master/src/utils/getAccessProviderContent.ts#L49

The plugin generates the @frontegg provider wrapper code into the relevant directory - src/.umi/plugin-frontegg-access within the dashboard repository.

When we try initializing the dashboard, we get the following error.

TypeError: can't access property "store", _useReduxContext is null
useSelector
./node_modules/react-redux/es/hooks/useSelector.js:121

  118 |   }
  119 | }
  120 | 
> 121 | var _useReduxContext = useReduxContext(),
      | ^  122 |     store = _useReduxContext.store,
  123 |     contextSub = _useReduxContext.subscription;
  124 | 

To Reproduce
Steps to reproduce the behavior:

  1. Clone the boilerplate dashboard here: https://github.com/Network-Chimp/dashboard
  2. cd dashboard; npm i; npm start
  3. Navigate to http://localhost:8000/
  4. Observe the TypeError
  5. Inspect the provider file at src/.umi/plugin-frontegg-access

Expected behavior

The dashboard should load with the provided Frontegg data.

Screenshots
Screen Shot 2021-05-21 at 8 57 10 AM

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

3 participants