Angular2 AoT Compiler Errors
See original GitHub issueI have updated an ionic2 project from beta 11 to rc0 and so it’s now using angular 2.0.0 instead of rc4. I’m no longer able to compile and getting this error:
Error: Error encountered resolving symbol values statically. Calling function ‘createStore’, function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in c:/Ionic/ionic-redux-test/.tmp/app/app.module.ts, resolving symbol AppModule in c:/Ionic/ionic-redux-test/.tmp/app/app.module.ts
These are the modifications I’ve made in app.module.ts in order to use the redux store and I think this is giving those errors:
Just before @NgModule
//Redux - ReduxThunk - rootReducer
import { Store, createStore, applyMiddleware } from 'redux';
import ReduxThunk from 'redux-thunk';
import { rootReducer } from '../modules/rootReducer';
const appStore = createStore(
rootReducer,
applyMiddleware(ReduxThunk)
);
And adding this in the providers array:
providers: [
{ provide: 'AppStore', useValue: appStore }
]
- Node (for AoT issues):
node --version
=
Node v4.2.6 npm v3.8.2
Any ideas on what should be done differently?
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (5 by maintainers)
Take a look at ngrx/store and ng2-redux. Difference between projects.
Take a look how they create aot-friendly reducer in this project https://github.com/ngrx/example-app/blob/master/src/app/reducers/index.ts#L81