facebookarchive / flux

Application Architecture for Building User Interfaces
https://facebookarchive.github.io/flux/
Other
17.45k stars 3.46k forks source link

Uncaught TypeError: this._callbacks[id] is not a function #273

Closed mars76 closed 8 years ago

mars76 commented 9 years ago

I updated my node and npm versions and then i started getting the following Error:

Uncaught TypeError: this._callbacks[id] is not a function

Uncaught TypeError: this._callbacks[id] is not a function_invokeCallback @ build.js:212dispatch @ build.js:188loginUser @ build.js:28479login @ build.js:28893executeDispatch @ build.js:6975SimpleEventPlugin.executeDispatch @ build.js:21216forEachEventDispatch @ build.js:6963executeDispatchesInOrder @ build.js:6984executeDispatchesAndRelease @ build.js:6353forEachAccumulated @ build.js:23237EventPluginHub.processEventQueue @ build.js:6560runEventQueueInBatch @ build.js:14926ReactEventEmitterMixin.handleTopLevel @ build.js:14952handleTopLevelImpl @ build.js:15038Mixin.perform @ build.js:22192ReactDefaultBatchingStrategy.batchedUpdates @ build.js:13370batchedUpdates @ build.js:20363ReactEventListener.dispatchEvent @ build.js:15132

node version i am using is v0.12.7.

My package.json has the following dependencies

"dependencies": { "bootstrap": "^3.3.0",

"flux": "^2.1.1",
"jwt-decode": "^1.1.0",
"react": "^0.13.3",
"react-mixin": "^1.1.0",
"react-router": "^0.13.2",
"reqwest": "^1.1.5",
"when"   :"^3.7.2"

}, "devDepedencies":{ "babelify": "^6.1.0", "browser-sync": "^2.1.6", "browserify": "^8.0.3", "clean-css": "^3.1.9", "eslint": "^0.14.1", "rework": "^1.0.1", "rework-npm": "^1.0.0", "rework-npm-cli": "^0.1.1", "serve": "^1.4.0", "uglify-js": "^2.4.15", "watchify": "^2.1.1" }

Thanks

kyldvs commented 9 years ago

It sounds like you are registering something with the dispatcher that isn't a function.

mattdell commented 9 years ago

This happened to me because I was setting an internal variable in the Flux store as

this._var = true

instead of

_var = true

Simple mistake and took me a fair bit of debugging to catch that. Hope it helps anyone else with this issue.

csomakk commented 7 years ago

i had to remove dispatcher.register(this.handleActions); cause i deleted handleActions()