React-Admin installation error: Has no exported member 'CombinedState'

Viewed 391

I have installed react-admin with npm and after the build,
I get this error:

node_modules/redux/index: has no exported member 'CombinedState'. TS2694

and it's linked to the file:

declare const _default: import("redux").Reducer<import("redux").CombinedState<{
   resources: any;
   customQueries: any;
   loading: any;
   notifications: any;
   references: any;
   ui: any;
}>, import("redux").AnyAction>;

There is no CombinedState in the redux, how do I fix that?

1 Answers

This sounds like a troubleshooting issue.

But first a quick dive in to understand where CombinedState is originating from,
and I'll base my explanation off actual files.

  1. Within ...\node_modules\redux\index.d.ts [lines 35-56],
    you'll notice that CombinedState is actually a type declared within redux.
    And indeed, it's actually exported!

  2. Also note that all the reducer functionality used by react-admin is defined within ra-core,
    a package upon which react-admin depends.

Within ra-core, inspect folders ...\esm\reducer and ...\lib\reducer, that's where this line:

import("redux").CombinedState

is used mostly - meaning that CombinedState is being imported.

Possible Solutions:

  • First, please confirm that your react-admin and redux installations aren't corrupted.
    It might not have occured to you, but I have often had to re-install packages due to this.
  • Check that the redux version in use corresponds with the react-admin you're using.
    The best way to verify is to look at the package.json file within the react-admin demo.
    Since it works, all must be fine, right!?

These suggestions are based off, working with react-admin v3.2.1.
Please let us know what helped you. Thanks.

Related