[英]@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.