ngrx import in angular application
Asked Answered
P

3

6

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

Pellegrini answered 17/2, 2021 at 8:26 Comment(0)
F
6

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

Flounce answered 17/2, 2021 at 11:53 Comment(0)
E
3

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]

Emylee answered 11/4, 2021 at 9:42 Comment(1)
For some reason, 10.2.1 refused to install for me with Angular CLI 9.1.12 & Typescript 3.8.3. @ngrx/[email protected] worked okay though.Isotonic
J
1

Try to uninstall or delete the node modules and again reinstall node modules through the npm install or ng serve. the nodemodules will be installed again, now try to run the error will be resolved.

Jed answered 30/10, 2023 at 7:15 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.