@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
};
有没有人遇到过类似的问题?在最好的情况下找到了解决方案?
不,(很遗憾)我的代码没有开源。
所以我今天早上将 @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
};
有没有人遇到过类似的问题?在最好的情况下找到了解决方案?
不,(很遗憾)我的代码没有开源。