Iron:router パッケージで Meteor を使用しています。基本的なテンプレートをレイアウト テンプレートにレンダリングしようとしていますが、エラーが発生し続けます。
Exception from Tracker recompute function: Error: Couldn't find a template named "/" or "". Are you sure you defined it?
私の「/」ルートには、次のものがあります。
// router.js
Router.configure({
layout: 'layout'
});
Router.route('/', function () {
this.render('welcome');
});
私のテンプレートは次のようになります。
<!--main.html -->
<head>
<title>App</title>
</head>
<body>
</body>
<template name='layout'>
<div id='container'>
{{> yield}}
</div>
</template>
<template name='welcome'>
<p>Welcome</p>
</template>
私のパッケージでは、最初は iron:router プラグインだけをインストールしようとしました。iron:core、iron:dynamic-templates、iron:layout が追加されたようです。それ以来、各ライブラリを個別に追加しました:
> meteor list
iron:core 0.3.4 Iron namespace and utilities.
iron:dynamic-template 0.4.1 Dynamically create and update templates and the...
iron:layout 0.4.1 Dynamic layouts which enable rendering dynamic ...
iron:router 0.9.4 Routing specifically designed for Meteor
meteor-platform 1.1.1 Include a standard set of Meteor packages in yo...