[Error] Generic type 'ActionReducerMap' requires 3 type argument(s)
thisisgit opened this issue ยท 6 comments
Hi, I'm new to ngrx and getting the error below when trying use ActionReducerMap. I checked the version of @ngrx/store and is 4.0.0 and also tried to uninstall and install to check if there's issue while installing, but still seeing the same error (Generic type 'ActionReducerMap' requires 3 type argument(s)).
So I tried checking what's in ActionReducerMap (models.d.ts), and I see the error below. I tried changing ... extends Action = Action>
to ...extends Action>
and the errors disappear in models.d.ts but in ActionReducerMap, now it says Generic type 'ActionReducerMap' requires 2 type argument(s)
.
Compile errors:
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (6,52): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (9,58): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (12,59): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (15,51): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (10,21): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (13,18): Generic type 'ActionReducerMap' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (13,75): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (17,15): Generic type 'ActionReducerMap' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (17,40): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (18,21): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/models.d.ts (20,20): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/reducer_manager.d.ts (6,68): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/reducer_manager.d.ts (11,61): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/reducer_manager.d.ts (16,84): Generic type 'ActionReducerMap' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/reducer_manager.d.ts (16,128): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/reducer_manager.d.ts (17,77): Generic type 'StoreFeature<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/reducer_manager.d.ts (18,26): Generic type 'StoreFeature<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/reducer_manager.d.ts (19,38): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (15,53): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (21,40): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (22,43): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (23,43): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (12,27): Generic type 'StoreFeature<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (17,22): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (18,20): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (21,60): Generic type 'ActionReducerMap' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (21,100): Generic type 'ActionReducerMap' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (21,134): Generic type 'StoreConfig' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (22,84): Generic type 'ActionReducerMap' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (22,117): Generic type 'StoreConfig' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (23,83): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store_module.d.ts (23,113): Generic type 'StoreConfig' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/state.d.ts (16,57): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/state.d.ts (20,57): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/state.d.ts (20,84): Generic type 'StateActionPair' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/state.d.ts (20,142): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/state.d.ts (20,165): Generic type 'StateActionPair' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store.d.ts (21,31): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store.d.ts (25,46): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/store.d.ts (25,78): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/utils.d.ts (2,61): ',' expected.
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/utils.d.ts (2,81): Generic type 'ActionReducerMap' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/utils.d.ts (2,133): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/utils.d.ts (12,62): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/utils.d.ts (12,109): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/node_modules/@ngrx/store/src/utils.d.ts (12,137): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
ERROR in /{proj_folder}/src/app/core/state-management/reducers/index.ts (40,26): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
I managed to get rid of all those compile errors by replacing all ... extends Action = Action>
to ...extends Action>
, and when typing ActionReduceMap or ActionReduce, I used ActionReduce<State,Action>
, not ActionReduce<State>
. Is it only me who's having this issue?
You need to update your version of TypeScript to 2.4.1
I still see this
@angular/* : 4.2.0
@ngrx/core: 1.2.0
@ngrx/store: 4.0.3
Typescript : 2.4.1
node : 7.0.0
npm : 3.10.8
ERROR in /Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (6,52): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (9,58): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (12,59): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (15,53): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (16,51): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (10,21): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (13,18): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (13,75): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (15,75): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (15,99): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (18,15): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (18,40): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (19,21): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/models.d.ts (21,20): Generic type 'MetaReducer' requires 3 type argument(s).
ERROR in /Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/reducer_manager.d.ts (6,68): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/reducer_manager.d.ts (11,61): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/reducer_manager.d.ts (16,84): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/reducer_manager.d.ts (16,128): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/reducer_manager.d.ts (17,77): Generic type 'StoreFeature<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/reducer_manager.d.ts (18,26): Generic type 'StoreFeature<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/reducer_manager.d.ts (19,38): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (16,53): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (22,40): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (23,43): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (24,43): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (13,27): Generic type 'StoreFeature<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (13,70): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (18,22): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (19,20): Generic type 'MetaReducer' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (22,60): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (22,100): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (22,134): Generic type 'StoreConfig' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (23,84): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (23,117): Generic type 'StoreConfig' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (24,83): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (24,113): Generic type 'StoreConfig' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (26,76): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (26,119): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (27,87): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store_module.d.ts (27,141): Generic type 'ActionReducerMap' requires 3 type argument(s).
ERROR in /Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/state.d.ts (16,57): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/state.d.ts (20,57): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/state.d.ts (20,84): Generic type 'StateActionPair' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/state.d.ts (20,142): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/state.d.ts (20,165): Generic type 'StateActionPair' requires 3 type argument(s).
ERROR in /Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store.d.ts (21,31): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store.d.ts (25,46): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/store.d.ts (25,78): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
ERROR in /Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/utils.d.ts (2,61): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/utils.d.ts (12,66): ',' expected.
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/utils.d.ts (2,81): Generic type 'ActionReducerMap' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/utils.d.ts (2,133): Generic type 'ActionReducer<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/utils.d.ts (12,92): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/utils.d.ts (12,135): Generic type 'MetaReducer' requires 3 type argument(s).
/Users/yyyyyyyy/Documents/workspace/xxxxxx/node_modules/@ngrx/store/src/utils.d.ts (12,157): Generic type 'ActionReducerFactory<T, V, Action>' requires 3 type argument(s).
@afirdousi what version of RxJS are you on? You should have at least TypeScript 2.4.2, RxJS 5.4.2 and remove @ngrx/core
from your project to use V4.x
What solved this for me:
Uninstall all ngrx dependencies first: npm uninstall @ngrx/store @ngrx/effects @ngrx/core --save
Then re-install the latest dependencies WITHOUT core: npm install --save @ngrx/store @ngrx/effects