TypeError: Object #<Object> has no method 'removeListener' #462

Closed
balupton opened this Issue Mar 17, 2013 · 5 comments

Comments

Projects
None yet
2 participants
Owner

balupton commented Mar 17, 2013

Been getting these errors a lot since v6.25.0 on the balupton and docpad websites. Need to be fixed, but I'm not yet sure what is causing the problem.

info: Generating...
error: An error occured: 
TypeError: Object #<Object> has no method 'removeListener'
    at g (events.js:174:10)
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:39:27)
    at Object.<anonymous> (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/events.js:49:30)
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at run (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:543:30)
    at _Class.balUtilFlow.Group._Class.runTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:548:11)
    at _Class.balUtilFlow.Group._Class.nextTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:517:14)
    at _Class.balUtilFlow.Group._Class.complete (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:436:18)
    at /Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:450:31
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:46:9)
    at /Users/balupton/Projects/docpad/out/lib/plugin.js:89:26
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at Object.<anonymous> (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/events.js:49:30)
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at run (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:543:30)
    at _Class.balUtilFlow.Group._Class.runTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:548:11)
    at _Class.balUtilFlow.Group._Class.nextTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:517:14)
    at _Class.balUtilFlow.Group._Class.complete (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:436:18)
    at /Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:450:31
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:46:9)
    at /Users/balupton/Projects/docpad/out/lib/plugin.js:89:26
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at Object.<anonymous> (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/events.js:49:30)
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at run (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:543:30)
    at _Class.balUtilFlow.Group._Class.runTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:548:11)
    at _Class.balUtilFlow.Group._Class.nextTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:517:14)
    at _Class.balUtilFlow.Group._Class.complete (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:436:18)
    at /Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:450:31
    at /Users/balupton/Projects/docpad/out/lib/docpad.js:848:18
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at Object.<anonymous> (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/events.js:49:30)
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at run (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:543:30)
    at _Class.balUtilFlow.Group._Class.runTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:548:11)
    at _Class.balUtilFlow.Group._Class.nextTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:517:14)
    at _Class.balUtilFlow.Group._Class.run (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:562:18)
    at _Class.balUtilFlow.Group._Class.serial (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:593:12)
    at _Class.balUtilFlow.Group._Class.sync (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:588:19)
    at DocPad.EventEmitterEnhanced.emitSync (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/events.js:52:13)
    at DocPad.generatePostpare (/Users/balupton/Projects/docpad/out/lib/docpad.js:2599:12)
    at DocPad.generatePostpare (/Users/balupton/Projects/docpad/out/lib/docpad.js:734:48)
    at /Users/balupton/Projects/docpad/out/lib/docpad.js:2696:27
    at _Class.balUtil.flow.next (/Users/balupton/Projects/docpad/out/lib/docpad.js:2575:16)
    at _Class.balUtilFlow.Group._Class.exit (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:479:14)
    at _Class.balUtilFlow.Group._Class.complete (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:438:18)
    at /Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:450:31
    at _Class.next (/Users/balupton/Projects/docpad/out/lib/docpad.js:2361:16)
    at _Class.balUtilFlow.Group._Class.exit (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:479:14)
    at _Class.balUtilFlow.Group._Class.complete (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:438:18)
    at /Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:450:31
    at CleanUrlsPlugin.writeAfter (/Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cleanurls/out/cleanurls.plugin.js:110:9)
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at /Users/balupton/Projects/docpad/out/lib/plugin.js:89:26
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at Object.<anonymous> (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/events.js:49:30)
    at Object.balUtilFlow.fireWithOptionalCallback (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:32:27)
    at run (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:543:30)
    at _Class.balUtilFlow.Group._Class.runTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:548:11)
    at _Class.balUtilFlow.Group._Class.nextTask (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:517:14)
    at _Class.balUtilFlow.Group._Class.complete (/Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:436:18)
    at /Users/balupton/Projects/docpad/node_modules/bal-util/out/lib/flow.js:450:31
    at _Class.next (/Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/out/cachr.plugin.js:133:18)
    at _Class.balUtilFlow.Group._Class.exit (/Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/node_modules/bal-util/out/lib/flow.js:479:14)
    at _Class.balUtilFlow.Group._Class.complete (/Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/node_modules/bal-util/out/lib/flow.js:438:18)
    at /Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/node_modules/bal-util/out/lib/flow.js:450:31
    at /Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/out/cachr.plugin.js:143:22
    at /Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/out/cachr.plugin.js:91:20
    at compare (/Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/node_modules/bal-util/out/lib/paths.js:835:20)
    at /Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/node_modules/bal-util/out/lib/paths.js:851:20
    at /Users/balupton/Projects/balupton.docpad/node_modules/docpad-plugin-cachr/node_modules/bal-util/out/lib/paths.js:102:18
    at Object.oncomplete (fs.js:93:15)
info: Regenerated at 22:22:21

If it helps, I only started getting these errors after upgrading to node v0.10.0 (previously on v0.8.18).

Owner

balupton commented Mar 22, 2013

Hrmm.... I haven't gotten these errors with 0.10.1, how about you?

I upgraded to v0.10.1 this morning and have still seen a couple of these error go past.

Owner

balupton commented Mar 23, 2013

Looked into it, the error is definitely thrown in the node code - it points to the removeListener call within the once call. Will look into it to see if the fix is within us, or Node.

balupton referenced this issue in nodejs/node-v0.x-archive Mar 23, 2013

events: add type checks to once
Also cleanup unnecessary use of "self" since it will always be called
using .apply() from emit.
Owner

balupton commented Mar 23, 2013

Fixed/worked-around the node.js change in bal-util v1.16.13

Reinstall docpad with the -f flag and you'll be good to go.

balupton added a commit that referenced this issue Mar 23, 2013

v6.26.2. Bugfix. Improvement.
- v6.26.2 March 23, 2013
	- Fixes `TypeError: Object #<Object> has no method 'removeListener'`
		- Thanks to [Steven Lindberg](https://github.com/slindberg) for
[issue #462](#462)
	- Can now customise the `watchOptions` that are used to construct the
[watchr](https://github.com/bevry/watchr) instances we create
	- Updated dependencies

balupton added a commit that referenced this issue Oct 23, 2013

v6.26.2. Bugfix. Improvement.
- v6.26.2 March 23, 2013
	- Fixes `TypeError: Object #<Object> has no method 'removeListener'`
		- Thanks to [Steven Lindberg](https://github.com/slindberg) for
[issue #462](#462)
	- Can now customise the `watchOptions` that are used to construct the
[watchr](https://github.com/bevry/watchr) instances we create
	- Updated dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment