Object #<Object> has not method 'setMaxListeners'
I'm experiencing this issue:
node version: 0.4.12 mongoose version: 2.3.0
node.js:134 throw e;
TypeError: Object #
at Document (/usr/local/lib/node_modules/mongoose/lib/document.js:29:8) at Model (/usr/local/lib/node_modules/mongoose/lib/model.js:25:12)
if it could be useful I'm trying to use node-heatmap (https://github.com/substack/node-heatmap) within a find response to create a new heat map.
probably I suppose it's a sort of incompatibly between these two models
interesting. is node-heatmap the only other lib you are using? does this error occur when you do not include node-heatmap?
nope there are some other modules loaded, but unused in that function.
btw I decided to make a little test with only these few modules:
- mongoose
- express
- sys
- fs
- util
- heatmap
and it still crash with the same issue.
I tried also to have only:
- mongoose
- heatmap
and it still fails on heatmap() function with the error above on mongoose libs
i can't reproduce this. heatmap and mongoose are working fine together for me. any other ideas?
I suffered this recently. found I needed to be sure to be creating a new model object when saving...
I'm having the same issue and here's my code.
https://gist.github.com/1294757
@pennyfx - Thanks for the gist, I am now able to reproduce (finally). Looking into it
got it, take a look at the gist posted by @pennyfx. You'll see on line 27
var Post = mongoose.Model('Post');.
This should instead be
var Post = mongoose.model('Post');.
Note the capitalization of model.
Woot, thanks!