Hi,
I’m having trouble building my application, it works fine when I use ionic serve
but when trying to build I get this error :
[14:13:43] Error: Error encountered resolving symbol values statically. Function calls are not supported.
Consider replacing the function or lambda with a reference to an exported function, resolving
symbol AllReducers in .tmp/app/app.module.ts, resolving
symbol AppModule in.tmp/app/app.module.ts, resolving
symbol AppModule in .tmp/app/app.module.ts
[14:13:43] ngc failed
[14:13:43] ionic-app-script task: "build"
[14:13:43] Error: Error
I understand where the problem come from, here is the part in my app.module.ts file that provoc the error.
export function AllReducers () {
return compose(
localStorageSync(['session'], true),
combineReducers
)({
session: SessionReducer,
categories: CategoryReducer,
products: ProductReducer,
presences: PresenceReducer,
clients: ClientReducer,
navigation: NavigationReducer,
current_categories: CurrentCategoriesReducer,
});
};
@NgModule({
declarations: [
MyApp,
LoginPage,
LogoutPage,
HomePage,
CatalogPage,
CategoryPage,
ProductPage,
PresencePage,
ClientListPage,
ClientViewPage,
],
imports: [
IonicModule.forRoot(MyApp),
EffectsModule.run(SessionEffects),
EffectsModule.run(CatalogEffects),
EffectsModule.run(PresenceEffects),
EffectsModule.run(ClientEffects),
StoreModule.provideStore(AllReducers())
],
...
The problem come from the call to AllReducers()
when I remove the parentheses the build works fine but the app does not work anymore.
I have tried with a export const allReducers = compose(...);
but it doesn’t work eather.
Here are my ionic info :
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 0.0.36
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v4.2.6
Xcode version: Not installed
How should I declare and call my AllReducers export so that it works properly with eveything ?
Thanks for any help.
David