简体   繁体   中英

@ngrx/store@11.0.0 Error during template compile of 'StoreModule'

so I've update @ngrx to its latest releases this morning:

-   "@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 has already been migrated to @^11.0.0 before, everything worked well with @ngrx/store@10.1.2 . despite the invalid peerDependency , of course.

now my build ( ng build [PROJECT_NAME] ) got stuck 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.

I've already figured out, that the cause is somehow related to StoreModule.forFeature('auth', reducers) which I import in a submodule. the root AppModule imports StoreModule.forRoot(reducers, { metaReducers }), . I cannot really find an error, feature reducers combined as following:

export interface AuthStateData {
  status: fromAuth.AuthStateData;
  loginPage: fromLoginPage.LoginStateData;
}

export const reducers: ActionReducerMap<AuthStateData> = {
  status: fromAuth.reducer,
  loginPage: fromLoginPage.reducer
};

has anyone experienced similar issues? and in the best case found a solution?

no, (sadly) my code is not open sourced.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM