0

When I try to deploy my Ionic 2 application to my android device I get the following error:

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 reducers in /Users/ibnclaudius/Development/egglr/egglr-mobile/.tmp/reducers/index.ts, resolving symbol AppModule in /Users/ibnclaudius/Development/egglr/egglr-mobile/.tmp/app/app.module.ts, resolving symbol AppModule in /Users/ibnclaudius/Development/egglr/egglr-mobile/.tmp/app/app.module.ts

index.ts (the part of the code that is giving error)

import { compose } from '@ngrx/core/compose';

export const reducers = compose(storeLogger(), combineReducers)({
  events: fromEvents.eventsReducer,
  subscriptions: fromSubscriptions.subscriptionsReducer
});

1 Answers1

0

Try this

import { compose } from '@ngrx/core/compose';

export interface IReducerDef {
    put: string;
    definition: string;
    here: string;
    // or use whatever definition is result of the compose function
}

export function composeFunction(): IReducerDef {
    return new compose(storeLogger(), combineReducers)({
        events: fromEvents.eventsReducer,
        subscriptions: fromSubscriptions.subscriptionsReducer
    });
}

export const reducers: IReducerDef = composeFunction();
brando
  • 8,215
  • 8
  • 40
  • 59
  • 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 composeFunction –  Dec 13 '16 at 18:25
  • Just a hunch, try the code now. I added "new" in the "return new compose(storeLogger(), combineReducers)" etc – brando Dec 13 '16 at 18:38
  • and where are you getting storeLogger() from? – brando Dec 13 '16 at 18:44
  • Error: Only a void function can be called with the 'new' keyword and `import { storeLogger } from 'ngrx-store-logger';` –  Dec 13 '16 at 18:53