Meteor.js错误:来自sub xGHk6PkFTQ9uv8ncg的异常TypeError:无法调用undefined方法'find'

时间:2014-01-31 10:10:14

标签: javascript jquery node.js meteor

我突然收到以下错误

 Exception from sub xGHk6PkFTQ9uv8ncg TypeError: Cannot call method 'find' of undefined
     at null._handler (app/server/publications.js:6:22)
     at maybeAuditArgumentChecks (packages/livedata/livedata_server.js:1349)
     at _.extend._runHandler (packages/livedata/livedata_server.js:796)
     at _.extend._startSubscription (packages/livedata/livedata_server.js:690)
     at _.extend.protocol_handlers.sub (packages/livedata/livedata_server.js:508)
     at packages/livedata/livedata_server.js:472

publications.js第6行的代码是:

Meteor.publish('users', function() {
    return Meteor.users.find( {}, {fields:{'age': 1}} )
});

为什么会导致错误,我们如何解决?

1 个答案:

答案 0 :(得分:1)

发现accounts-password突然失踪,造成了这个问题。