gor181 / react-notification-system-redux

Redux wrapper for react-notification-system
MIT License
324 stars 59 forks source link

Uncaught TypeError: Cannot read property 'dispatch' of undefined #72

Closed cristian-sima closed 5 years ago

cristian-sima commented 5 years ago

So. I create a notification using createNotification("error"), it is displayed, then when the notification should be deleted I receive this

image

This is my configuration:

{ 
"dependencies": {
    "@sentry/browser": "^4.5.3",
    "babel-core": "^6.26.3",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^23.6.0",
    "babel-loader": "^8.0.4",
    "babel-plugin-add-module-exports": "^1.0.0",
    "babel-plugin-flow-react-proptypes": "^24.1.2",
    "babel-plugin-react-html-attrs": "^2.1.0",
    "babel-plugin-syntax-flow": "^6.18.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-decorators-legacy": "^1.3.5",
    "babel-plugin-transform-flow-strip-types": "^6.22.0",
    "babel-plugin-transform-react-constant-elements": "^6.23.0",
    "babel-plugin-transform-react-inline-elements": "^6.22.0",
    "babel-plugin-transform-react-remove-prop-types": "^0.4.20",
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1",
    "big.js": "^5.2.2",
    "bootstrap": "^4.1.3",
    "classnames": "^2.2.6",
    "copy": "^0.3.2",
    "cross-env": "^5.2.0",
    "css-loader": "^1.0.1",
    "dezalgo": "^1.0.3",
    "es3ify": "^0.2.2",
    "eslint": "^5.9.0",
    "eslint-plugin-flowtype": "^3.2.0",
    "eslint-plugin-jsx-a11y": "^6.1.2",
    "eslint-plugin-react": "^7.11.1",
    "file-loader": "^2.0.0",
    "flow-bin": "^0.86.0",
    "flow-status-webpack-plugin": "^0.1.7",
    "font-awesome": "^4.7.0",
    "fs": "0.0.1-security",
    "glob": "^7.1.3",
    "history": "^4.7.2",
    "humps": "^2.0.1",
    "immutable": "^4.0.0-rc.12",
    "jest": "^23.6.0",
    "jest-immutable-matchers": "^2.0.1",
    "json-loader": "^0.5.7",
    "lodash.memoize": "^4.1.2",
    "moment": "^2.22.2",
    "node-sass": "^4.10.0",
    "normalizr": "^3.3.0",
    "npm": "^6.4.1",
    "postcss-loader": "^3.0.0",
    "query-string": "^6.2.0",
    "react": "^16.6.3",
    "react-addons-shallow-compare": "^15.6.2",
    "react-autosuggest": "^9.4.2",
    "react-dom": "^16.6.3",
    "react-dropzone": "^7.0.1",
    "react-hot-loader": "^4.3.12",
    "react-loadable": "^5.5.0",
    "react-notification-system-redux": "^1.2.0",
    "react-raphael": "^0.9.0",
    "react-redux": "^6.0.1",
    "react-router": "^4.3.1",
    "react-router-dom": "^4.3.1",
    "react-router-redux": "^5.0.0-alpha.9",
    "react-select": "^2.3.0",
    "react-sidebar": "^3.0.2",
    "reactstrap": "^6.5.0",
    "redux": "^4.0.1",
    "redux-form": "^8.1.0",
    "redux-immutable": "^4.0.0",
    "redux-injector": "^0.1.0",
    "redux-promise-middleware": "^5.1.1",
    "redux-saga": "^0.16.2",
    "redux-thunk": "^2.3.0",
    "redux-ui": "0.1.1",
    "reselect": "^4.0.0",
    "sass-loader": "^7.1.0",
    "scss-compile": "^0.1.7",
    "style-loader": "^0.23.1",
    "superagent": "^4.0.0",
    "superagent-promise": "^1.1.0",
    "url-loader": "^1.1.2",
    "webpack": "^4.26.0",
    "webpack-cli": "^3.1.2",
    "webpack-git-hash": "^1.0.2",
    "webpack-preset": "^0.2.0",
    "webpack-preset-babel": "^0.2.0",
    "webpack-preset-babel-stage-2": "^0.2.0"
  }
}
cristian-sima commented 5 years ago

image

cristian-sima commented 5 years ago

One of the packages was an old version of this package and it had a conflict

sfeese commented 5 years ago

Hi @cristian-sima, I'm facing the same problem. Do you remember what package caused the trouble and how you fixed the error? Thx.

ollystephens1 commented 5 years ago

I was also facing this issue. I found that removing "react-notification-system" from my package fixed it. Seems to work fine with only the redux version.

Huzaifaahmed20 commented 5 years ago

I was also facing this issue. I found that removing "react-notification-system" from my package fixed it. Seems to work fine with only the redux version.

i remove "react-notification-system" but same error

tratatun commented 4 years ago

I fixed that simply updating dependency version "react-notification-system-redux": "^1.2.0", to "react-notification-system-redux": "^2.0.0",

hope, it helped you guys.