4
votes

I am trying to import NGRX to build a new Angular application but i have this error in my terminale when i use ng serve:

ERROR in node_modules/@ngrx/store/src/reducer_creator.d.ts:32:99 - error TS1005: ',' expected.

32 export declare function on<State, Creators extends readonly ActionCreator[]>(...args: [...creators: Creators, reducer: OnReducer<State, Creators>]): ReducerTypes<State, Creators>; ~ node_modules/@ngrx/store/src/reducer_creator.d.ts:32:118 - error TS1005: ',' expected.

32 export declare function on<State, Creators extends readonly ActionCreator[]>(...args: [...creators: Creators, reducer: OnReducer<State, Creators>]): ReducerTypes<State, Creators>;

This Is my angular cli / node version / OS Angular CLI: 9.1.0 Node: 10.13.0 OS: darwin x64

2

2 Answers

5
votes

NgRx v11 expects TypeScript 4 to be used and Angular 11. https://ngrx.io/guide/migration/v11

1
votes

Downgrade the @ngrx/store to 10.2.1 or lower version.

cmd: yarn add @ngrx/[email protected]

If you are using npm then

cmd: npm install @ngrx/[email protected]