vitorbal / backbone-redux-store-example

1 stars 0 forks source link

App breaks on bbCreateStore function #1

Open dinocarl opened 7 years ago

dinocarl commented 7 years ago

I can't get the application to run, because the bbCreateStore function errors when it tries to call apply on the enhancer variable. Based on the logic above it in the function, it'll choose the 2nd argument, which returns as an object, and so doesn't have it available:

Uncaught TypeError: enhancer.apply is not a function
    at composedEnhancers (index.js:141)
    at createStore (createStore.js:65)
    at eval (index.js:143)
    at eval (webpack:///./src/index.js?:53)
    at Object.<anonymous> (bundle.js:1327)
    at __webpack_require__ (bundle.js:556)
    at fn (bundle.js:87)
    at eval (webpack:///multi_main?:4)
    at Object.<anonymous> (bundle.js:589)
    at __webpack_require__ (bundle.js:556)

Any tips on how to resolve?

vitorbal commented 7 years ago

Thanks for the issue! I'm sorry your having problems with your application. backbone-redux-store is still experimental, so we have some rough edges to work out.

Just to be sure, are you trying to run the code as is from this example in this repository or did you do any modifications?

dinocarl commented 7 years ago

Thanks for the quick response! The problem was there from the outset. I made no modifications. FWIW, My system is using node v 6.1.0

dinocarl commented 7 years ago

I also get the identical error when doing a prod build.

vitorbal commented 7 years ago

Thanks for the follow up, that definitely shouldn't be happening. I'm away from home until Monday but I'll investigate more as soon as I'm back!

toonketels commented 7 years ago

@vitorbal The example app is incompatible with backbone-redux-store#0.1.1. It runs fine with master.

The function signature of the function returned by bbCreateStore has changed.

see: https://github.com/vitorbal/backbone-redux-store-example/blob/master/src/index.js#L25 and: https://github.com/adamterlson/backbone-redux-store/blob/v0.1.1/lib/index.js#L89

dinocarl commented 7 years ago

That got it working for me. Thanks, @toonketels.