gpt4 book ai didi

javascript - Meteor 没有方法 'subscribe' 。关于最新的 meteor 更新
转载 作者:行者123 更新时间:2023-11-30 07:23:51 24 4
gpt4 key购买 nike

即使我已成功升级到最新的 meteor,我仍然会收到此错误。谁能帮忙?

W20141002-17:08:01.669(-5)? (STDERR) 
W20141002-17:08:01.841(-5)? (STDERR) /Users/erikbigelow/.meteor/packages/meteor-tool/.1.0.33.kundj5++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
W20141002-17:08:01.842(-5)? (STDERR) throw(ex);
W20141002-17:08:01.842(-5)? (STDERR) ^
W20141002-17:08:01.843(-5)? (STDERR) TypeError: Object #<Object> has no method 'subscribe'
W20141002-17:08:01.843(-5)? (STDERR) at app/main.js:1:43
W20141002-17:08:01.843(-5)? (STDERR) at app/main.js:3:3
W20141002-17:08:01.844(-5)? (STDERR) at /Users/erikbigelow/Sites/scenewith/.meteor/local/build/programs/server/boot.js:168:10
W20141002-17:08:01.844(-5)? (STDERR) at Array.forEach (native)
W20141002-17:08:01.845(-5)? (STDERR) at Function._.each._.forEach (/Users/erikbigelow/.meteor/packages/meteor-tool/.1.0.33.kundj5++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
W20141002-17:08:01.845(-5)? (STDERR) at /Users/erikbigelow/Sites/scenewith/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8

这是我删除自动发布后直接添加的

服务器/publications.js:

Meteor.publish('scenes', function() {
return Scenes.find();
});

主要.js

Meteor.subscribe('scenes');

collections/scenes.js

Scenes = new Meteor.Collection('scenes');

最佳答案

从日志来看,您似乎正试图在服务器上调用 Meteor.subscribe,或者至少不仅仅是在客户端上。

您的调用需要在客户端文件夹中,或者在 Meteor.isClient block 中,因为它是 client only method , 所以它不会附加到服务器上的 Meteor 对象。

关于javascript - Meteor <Object> 没有方法 'subscribe' 。关于最新的 meteor 更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26170595/

24 4 0