[Pipeline] sh
at /var/lib/jenkins/workspace/referral-sdk-js_jenkins-deploy/src/store/ConfigStore.js:2:9
[2m1: import { applyMiddleware, compose, createStore } from "redux"; 2: import { createLogger } from 'redux-logger' ^ 3: import reducers from "../redux"; 4: import thunk from "redux-thunk";[22m
Hi there and welcome,
So the error comes from line 2 for the ReactJs source code at src/store/ConfigStore.js
The error is coming from an import statement where you are trying to import createLogger
from the redux-logger
package, and it can't find that function.
This is the line here:
import {createLogger} from 'redux-logger';
It cannot find createLogger or it's not exported.
This seems to be an error with the package, where you will find some solutions: https://github.com/LogRocket/redux-logger/issues/233
Some possible solutions will be to:
package.json
and finding the dependency react-logger
and finding an appropriate version that exports this function correctlyimport * as logger from 'redux-logger';
logger.__moduleExports.createLogger;
npm i @types/redux-logger
But I already have this in my code, still i am getting error with exporting
import { applyMiddleware, compose, createStore } from "redux";
import { createLogger } from 'redux-logger'
import reducers from "../redux";
import thunk from "redux-thunk";
const middleware = [createLogger(),thunk]
const ConfigStore = () => {
let store = null;
store = createStore(reducers,{},compose(applyMiddleware(...middleware)))
return store
}
export default ConfigStore()
Here is my package.json
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"axios": "^0.19.2",
"infinite-react-carousel": "^1.2.11",
"nuka-carousel": "^4.6.6",
"react": "^16.13.0 ",
"react-dom": "^16.13.0",
"react-items-carousel": "^2.8.0",
"react-meta-tags": "^0.7.4",
"react-redux": "^7.2.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.0",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"rollup-plugin-commonjs": "^10.1.0"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.