question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular2 AoT Compiler Errors

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DzmitryShylovichcommented, Oct 8, 2016

Take a look at ngrx/store and ng2-redux. Difference between projects.

1reaction
DzmitryShylovichcommented, Oct 7, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

AOT metadata errors - Angular
The following are metadata errors you may encounter, with explanations and ... Avoid this error by sticking to the compiler's restricted expression syntax ......
Read more >
Improved Error Logging by the Angular AOT Compiler
In Angular 10.1, another error logging improvement by the AOT compiler is introduced. Let's see how the error logging has improved over the...
Read more >
angular - Why won't aot compiler error on missing property?
AoT compiles the template beforehand, and is looking for the bindings to be generated. On the other hand, having it in an ng-container...
Read more >
Angular 6 AOT compilation not working - Error in ... - GitHub
Using @ngtools/webpack for AOT compiling works in my setup until version 1.8 which is ok for Angular 5. However, Angular 6 requires to...
Read more >
Angular: Writing AoT-friendly applications | by David - Medium
Angular CLI comes with built-in AoT support. In the development target environment, it uses JiT (Just-in-Time) compilation for better developer experiences and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found