簡體   English   中英

@ngrx/store@11.0.0 'StoreModule' 模板編譯期間出錯

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

所以我今天早上將@ngrx更新為最新版本:

-   "@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之前已經遷移到@^11.0.0 ,一切都與@ngrx/store@10.1.2配合得很好。 當然,盡管peerDependency無效。

現在我的構建( ng build [PROJECT_NAME] )卡住了拋出錯誤:

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.

我已經發現,原因與我在子模塊中導入的StoreModule.forFeature('auth', reducers)有關。 AppModule導入StoreModule.forRoot(reducers, { metaReducers }), 我真的找不到錯誤,功能縮減器組合如下:

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

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

有沒有人遇到過類似的問題? 在最好的情況下找到解決方案?

不,(遺憾的是)我的代碼不是開源的。

所以,這畢竟是一個錯誤:)

報告: https://github.com/ngrx/platform/issues/2919
修復: https://github.com/ngrx/platform/pull/2922

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM