ng-redux icon indicating copy to clipboard operation
ng-redux copied to clipboard

TypeError: _redux.compose.apply(...) is not a function

Open karlos1337 opened this issue 7 years ago • 4 comments

Hi all, I'm implementing ng-redux in an old project, all works fine in development but all karma tests fails with the message:

TypeError: _redux.compose.apply(...) is not a function

May I need to add something to karma.conf?

karlos1337 avatar Aug 10 '17 15:08 karlos1337

I have the same issue.

guysenpai avatar Aug 12 '17 18:08 guysenpai

is there someone here who has resolved this issue or has a solution for that?

guysenpai avatar Aug 23 '17 15:08 guysenpai

@karlos1337 @guysenpai Can either of you guys create a repo reproducing this so we can take a look?

deini avatar Sep 01 '17 15:09 deini

@karlos1337 @guysenpai For what it's worth, we had the same issue in our project, and it ended up being an problem with the redux dev tools not being available in the headless browser that karma was using.

We fixed it by conditionally checking if the redux tools were available before trying to pass them to $ngReduxProvider.createStoreWith.

Example:

const reduxDevTools:Function = _.get(window, '__REDUX_DEVTOOLS_EXTENSION__');
const enhancers = reduxDevTools ? [reduxDevTools()] : null;
const reduxBootstrap = $ngReduxProvider => {
    $ngReduxProvider.createStoreWith(reducer, [thunk], enhancers);
}

gthmb avatar Nov 29 '17 16:11 gthmb