[英]@ngrx/store Error on production build : Error during template compile of 'Store'
[英]@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.