Я получаю (0, redux.applymiddleware) ошибку для моего приложения Reaction-redux
Вот мой код для магазина:
import {c[enter image description here][2]reateStore, applyMiddleware} from 'redux';
import thunk from 'redux-thunk';
import imReducer from '../reducer';
import {ENQUIRY_FOLDER_NAMES} from '../constants/constants';
const logger = (store)=>(next)=>(action)=>{
if(typeof action !== "function"){
}
return next(action);
}
if(typeof(Storage) !== "undefined" && localStorage.getItem('id_token') != ''){
let initialState = {hasMoreFolders:true,isFetchingFolders:false,prodError:false,enqError:false,requesting:true,enquiries:[],authenticated:false,hasMoreItems:true,isFetching:false,updateMessage:'',myProducts:[],isFetchingMyProducts:false,hasMoreMyProducts:true,myWFOBProducts:[],user:[],prevPath:'',start:0,end:20,returnCC: "IN"};
}else{
let initialState = {hasMoreFolders:true,isFetchingFolders:false,prodError:false,enqError:false,requesting:true,enquiries:[],authenticated:false,hasMoreItems:true,isFetching:false,updateMessage:'',myProducts:[],isFetchingMyProducts:false,hasMoreMyProducts:true,myWFOBProducts:[],user:[],prevPath:'',start:0,end:20,returnCC: "IN"};
}
let initialState = {hasMoreFolders:true,isFetchingFolders:false,prodError:false,authenticated:false,enquiries:[],hasMoreItems:true,isFetching:false,updateMessage:'',myProducts:[],wfobpCount:false,isFetchingMyProducts:false,hasMoreMyProducts:true,myWFOBProducts:[],folders:ENQUIRY_FOLDER_NAMES,prodDetail:[],catData :{},isUploadingImage:false,imageData:{},imageUploaded:false,updatedItemId:false,itemUpdatedMyProduct:[],start:0,end:20,pageType:'All',enqType:'A',folderValue:1,buyleads:[],hasMoreBuyleads:true,isFetchingBuyleads:true,offerData:[],purchaseCreditResult:[],orderId:[],loc_count:[],listing_val:{},blstart:1,blend:10,lead_purchase:[],blPageType:0,offerDataExists:false,expired:false,suggested:[],requesting:true,enqError:false,returnCC: "IN",success:false,purchase:false,decodePackageBuyResp:'',blpopState:true,refresh:false,expiredShortlist:0,searchlist:[],searchstart:0,pbrData:{},objBl:{},searchData:{},searchend:13,tabValue:"",isFetchingSearch:false,isloadedSearch:false,hasMoreSearch:true,get_products:[],searchsuggested:[],get_recentsearches: [], get_recentrelatedmcats: [], premium_brands : [],products_loading : false,searches_loading: false, results_loading: false, country_ip:[] , country_iso:[], country_name:'IN', searcherror:false, getbrands:true, get_latestenqbls:'', updatebrands : false, updatecats : false, updateprods : false}
if(typeof window !== "undefined"){
var stateData = window.stateData;
initialState = Object.assign({}, initialState, stateData);
}
const imStore = createStore(
imReducer,
initialState,
applyMiddleware(logger, thunk)
);
export default imStore;
Вот пакеты, которые я использую как зависимости
"dependencies": {
"babel-core": "^6.24.0",
"babel-loader": "^6.4.1",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-register": "^6.24.1",
"bcrypt": "^1.0.2",
"body-parser": "^1.17.1",
"compression": "^1.7.1",
"constants": "0.0.2",
"cookie-parser": "^1.4.3",
"cors": "^2.8.3",
"css-loader": "^0.23.1",
"debug": "^2.6.6",
"encoding": "^0.1.12",
"express": "^4.15.2",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.10.1",
"formidable": "^1.1.1",
"geoip-lite": "^1.2.1",
"http": "0.0.0",
"import-export": "^1.0.1",
"inherits": "^2.0.3",
"ipaddr.js": "^1.3.0",
"isomorphic-fetch": "^2.2.1",
"json-loader": "^0.5.7",
"loader-utils": "^1.1.0",
"mime": "^1.3.6",
"next": "^2.3.1",
"node-env-file": "^0.1.8",
"node-fetch": "^1.6.3",
"node-uuid": "^1.4.8",
"path": "^0.12.7",
"preact": "^8.2.6",
"preact-compat": "^3.17.0",
"qs": "^6.4.0",
"react": "^15.5.4",
"react-addons-update": "^15.5.2",
"react-dom": "^15.5.4",
"react-helmet": "^5.2.0",
"react-hot-loader": "^1.3.1",
"react-html-parser": "^1.0.3",
"react-redux": "^5.0.4",
"react-router": "^3.0.5",
"react-scripts": "^0.7.0",
"react-toolbox": "^2.0.0-beta.7",
"react-virtualized": "^9.7.5",
"redux": "^3.6.0",
"redux-infinite-scroll": "^1.0.9",
"redux-thunk": "^2.2.0",
"register": "0.0.0",
"request": "^2.81.0",
"request-ip": "^2.0.2",
"serviceworker-webpack-plugin": "^0.2.1",
"style-loader": "^0.13.2",
"sw-precache-webpack-plugin": "^0.9.1",
"uglifyjs-webpack-plugin": "^0.4.6",
"url-loader": "^0.5.8",
"uuid": "^3.0.1",
"webpack": "^2.5.1",
"webpack-dev-middleware": "^1.10.2",
"webpack-hot-middleware": "^2.18.0"}
Этот код случайным образом выбрасывает вышеупомянутую ошибку (0 redux.applymiddleware)
Ошибка возникает периодически, и когда она возникает, она предотвращает дальнейшее выполнение кода!
Невозможно включить полный файл редуктора, поэтому добавлены скриншоты!
Файл редуктора
Файл редуктора, продолжение ....