build running before. After
is run with serve, this error is reported by initiating an asynchronous action. The middleware used by
is redux-thunk.
error message:
Uncaught Error: Actions must be plain objects. Use custom middleware for async actions.
at Object.performAction (<anonymous>:1:40685)
at liftAction (<anonymous>:1:34238)
at dispatch (<anonymous>:1:38232)
at Object.getSingleSearchResult (index.jsx:207)
at t.value (index.jsx:44)
at fa (react-dom.production.min.js:5065)
at da (react-dom.production.min.js:4826)
at ca (react-dom.production.min.js:4800)
at va (react-dom.production.min.js:5202)
at En (react-dom.production.min.js:1737)
store.js file:
import { createStore, applyMiddleware, compose } from "redux";
import reducer from "./reducer/";
import thunk from "redux-thunk";
const win = window;
const middlewares = [];
if (process.env.NODE_ENV !== "production") {
middlewares.push(thunk);
}
const storeEnhancers = compose(
applyMiddleware(...middlewares),
(win && win.devToolsExtension) ? win.devToolsExtension() : (f) => f
);
export default createStore(reducer, storeEnhancers);
Project address: Link description
what is the cause? Thank you