我在我的angular2项目中添加了reducers:
const rootReducer = compose(storeLogger(), combineReducers)({
toolbar: toolbarReducer
});
imports: [
...,
StoreModule.provideStore(rootReducer)
],
它正常工作,但当我尝试将其部署到github-pages
时ng github-pages:deploy
然后我最终得到以下错误:
ERROR in Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 12:42 in the original .ts file), resolving symbol compose in /Users/gkucmierz/learn/coin-tools/node_modules/@ngrx/core/compose.d.ts, resolving symbol AppModule in /Users/gkucmierz/learn/coin-tools/src/app/app.module.ts, resolving symbol AppModule in /Users/gkucmierz/learn/coin-tools/src/app/app.module.ts, resolving symbol AppModule in /Users/gkucmierz/learn/coin-tools/src/app/app.module.ts, resolving symbol AppModule in /Users/gkucmierz/learn/coin-tools/src/app/app.module.ts, resolving symbol AppModule in /Users/gkucmierz/learn/coin-tools/src/app/app.module.ts
我做错了什么?
答案 0 :(得分:1)
错误信息非常清楚 您必须为AoT静态分析您的代码。
此错误与github页面无关。
这将以JIT模式构建您的代码:ng build
这在AOT模式下:ng build --aot
github-pages:deploy
命令正在进行AOT构建。