gkucmierz
gkucmierz

Reputation: 1145

angular2 ngrx, error while deploying to github-pages

I added reducers to my angular2 project like this:

const rootReducer = compose(storeLogger(), combineReducers)({
  toolbar: toolbarReducer
});

  imports: [
    ...,
    StoreModule.provideStore(rootReducer)
  ],

It's working correctly, but when I try to deploy it to github-pages

ng github-pages:deploy

Then I end up with the following error:

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

What am I doing wrong?

Upvotes: 0

Views: 164

Answers (1)

Johannes Hoppe
Johannes Hoppe

Reputation: 261

The error message is pretty clear.
You have to make your code statically analyzable for AoT.

See here: https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5#.3ipjxwp1z

This error has nothing to do with github pages.

This builds your code in JIT mode: ng build
And this in AOT mode: ng build --aot
The github-pages:deploy command was doing AOT builds.

Upvotes: 1

Related Questions