I recently updated my @ngrx
packages to the latest versions:
- "@ngrx/effects": "10.1.2",
- "@ngrx/router-store": "10.1.2",
- "@ngrx/store": "10.1.2",
+ "@ngrx/effects": "11.0.0",
+ "@ngrx/router-store": "11.0.0",
+ "@ngrx/store": "11.0.0",
@angular/core
had already been upgraded to @^11.0.0
previously and everything was working fine with
@ngrx/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7a090e15081f3a4b4a544b5488">[email protected]</a>
, despite the invalid peerDependency
.
However, after the update, my build (ng build [PROJECT_NAME]
) started throwing errors:
An unhandled exception occurred: @ngrx/store/ngrx-store.ts(224,21): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(231,15): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(257,13): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(224,21): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(231,15): Error during template compile of 'StoreModule'
Expression form not supported.
@ngrx/store/ngrx-store.ts(257,13): Error during template compile of 'StoreModule'
Expression form not supported.
Upon investigation, I found that the issue seems to be related to
StoreModule.forFeature('auth', reducers)
which is imported in a submodule. The root AppModule
imports StoreModule.forRoot(reducers, { metaReducers }),
. Despite checking the feature reducers setup:
export interface AuthStateData {
status: fromAuth.AuthStateData;
loginPage: fromLoginPage.LoginStateData;
}
export const reducers: ActionReducerMap<AuthStateData> = {
status: fromAuth.reducer,
loginPage: fromLoginPage.reducer
};
Has anyone faced similar issues before and if so, were you able to find a solution?
Unfortunately, my code is not open source.