Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.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 0.8时,包含函数的返回值应为null或模板_Meteor - Fatal编程技术网

更新到meteor 0.8时,包含函数的返回值应为null或模板

更新到meteor 0.8时,包含函数的返回值应为null或模板,meteor,Meteor,我按照说明()尝试将项目从meteor0.7.2升级到meteor0.8.1.3,但遇到了一些错误和异常 错误: Uncaught Error: Expected null or template in return value from inclusion function, found: false localhost:3000/packages/spacebars.js?f49560fc90a8d71b7637d9596696078881b8c812:72 此错误来自helper.js,

我按照说明()尝试将项目从meteor0.7.2升级到meteor0.8.1.3,但遇到了一些错误和异常

错误:

Uncaught Error: Expected null or template in return value from inclusion function, found: false localhost:3000/packages/spacebars.js?f49560fc90a8d71b7637d9596696078881b8c812:72
此错误来自helper.js,其代码如下:

UI.registerHelper('renderHeader', function () {

   if (settingsSubscription.ready()) {
       return Template.header;
  }else {
      return "";
  }
});

在index.html中,我使用{renderHeader}}获得模板。我认为该错误意味着函数在SettingSubscription未就绪时返回空模板。那么,当settingSubscription未准备好时,我应该返回什么模板呢?

因为Meteor 0.8模板不是函数,而是对象,所以您不能像以前那样插入模板。 您应该看看作为Meteor 0.8的一部分引入的,它处理渲染的方式与旧的Spark engine非常不同,您的代码以前在Spark engine中工作


我还推荐目前最流行的软件包,它将帮助您以一种非常健壮的方式呈现布局(以及做更多的事情)。

因为Meteor 0.8模板不是函数,而是对象,所以您不能像以前那样插入模板。 您应该看看作为Meteor 0.8的一部分引入的,它处理渲染的方式与旧的Spark engine非常不同,您的代码以前在Spark engine中工作


我还推荐目前最流行的软件包,它将帮助您以一种非常健壮的方式呈现布局(以及做更多的事情)。

我建议您检查一下

在你的情况下,你只需要做

UI.registerHelper('renderHeader', function () {
 if (GroundDB.ready())
   return Template.header;
})
就这样说吧

{{> renderHeader}}

我建议你退房

在你的情况下,你只需要做

UI.registerHelper('renderHeader', function () {
 if (GroundDB.ready())
   return Template.header;
})
就这样说吧

{{> renderHeader}}

非常感谢,但例外仍然存在。非常感谢,但例外仍然存在。嗨,你有什么想法,@Tom ColemanHi,你有什么想法,@Tom ColemanHi,我指的是更新到meteor 0.8的指南。是的,我指的是更新到meteor 0.8的指南。