Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Meteor 流星路由器&x2B;幻影_Meteor_Phantomjs - Fatal编程技术网

Meteor 流星路由器&x2B;幻影

Meteor 流星路由器&x2B;幻影,meteor,phantomjs,Meteor,Phantomjs,我的Meteor应用程序使用Meteor路由器进行导航,并使用Spiderable插件获取搜索引擎索引的页面。Spiderable调用phantomjs来获取页面内容。这种方法适用于除主页外的大多数页面 '/': -> 'home' '/otherurl': -> 'otherpage' 我做了一些调试,发现spiderable.js中page.evaluate的回调在请求主页时总是返回false ... setInterval(function()

我的Meteor应用程序使用Meteor路由器进行导航,并使用Spiderable插件获取搜索引擎索引的页面。Spiderable调用phantomjs来获取页面内容。这种方法适用于除主页外的大多数页面

   '/': ->
    'home'
  '/otherurl': ->
    'otherpage'
我做了一些调试,发现spiderable.js中page.evaluate的回调在请求主页时总是返回false

...  
setInterval(function() {
  var ready = page.evaluate(function () {
    if (typeof Meteor !== 'undefined' && typeof(Meteor.status) !== 'undefined' && Meteor.status().connected) {
      Meteor.flush();
      return Meteor._LivedataConnection._allSubscriptionsReady();
    }
    return false;
  });
...

有什么建议吗?

发布路由器的
home
功能的代码。最后我发现是以下代码导致了问题:
Meteor.autosubscribe->Meteor.subscribe'items',Session.get('item_id')
因为启动会话时为空一直返回false,导致phantomjs挂断。您修复了此问题吗?如果是这样,请在下面发布答案:)在[meteor]标签中有太多问题的答案只存在于评论部分。