Closed evayde closed 6 years ago
Not super familiar with adding multiple middleware, but do any of these work?
compose(lazyReducerEnhancer(combineReducers),
applyMiddleware(logger, thunk))
compose(lazyReducerEnhancer(combineReducers),
applyMiddleware(logger),
applyMiddleware(thunk))
We are also working to update to Redux 4 in #200 - maybe it requires that version?
I fixed it myself. It has nothing to do with the redux version. The problem is importing the dist file. You have to import source-files for some middlewares, like so:
import logger from 'redux-logger/src';
I also have an angular project with redux and this project doesnt have this problem. So maybe it is worth mentioning somewhere or changing the configuration.
Thanks for investigating @evayde . Our setup/tooling requires the use of ES modules - since redux-logger doesn't have module
in package.json, we must rely on the the source which is written with ES modules.
It seems like it is a problem with pwa-helpers, but I am going to fill the issue here, because maybe I am just misunderstanding the configuration.
Reproduce:
open src/store.js, add lines:
change line:
compose(lazyReducerEnhancer(combineReducers), applyMiddleware(logger))
intocompose(lazyReducerEnhancer(combineReducers), applyMiddleware(...middleware))
and then npm start.
Error message:
Environment:
on an Ubuntu 18.04 LTS. node version: 10.6.0 npm version: 6.1.0
Am I doing it wrong? If so, please add another example to the documentation on how to add multiple Middlewares, too.