【发布时间】:2014-05-08 17:32:23
【问题描述】:
我刚刚将 Iron-router 更新到最新的 0.7.0 并出现错误。
在更新之前,我使用的是“dev”分支 Blaze,一切正常。
我在 /lib/router.js 中有 routes.js,因此它可以首先在客户端和服务器上加载。这是我运行 mrt 时遇到的错误:
Your app is crashing. Here's the latest log.
/Users/pemmy/.meteor/tools/c2a0453c51/lib/node_modules/fibers/future.js:173
throw(ex);
^
ReferenceError: Router is not defined
at app/lib/routes.js:1:36
at app/lib/routes.js:79:3
at /Users/pemmy/projects/Meteor/projects/toonokio/.meteor/local/build/programs/server/boot.js:155:10
at Array.forEach (native)
at Function._.each._.forEach (/Users/pemmy/.meteor/tools/c2a0453c51/lib/node_modules/underscore/underscore.js:79:11)
at /Users/pemmy/projects/Meteor/projects/toonokio/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
这是我的 router.js 文件中的内容:
1. Router.configure({
2. // layoutTemplate: 'basicLayout',
3. notFoundTemplate: 'notFound',
4. yieldTemplates: {
5. // 'header': { to: 'header' },
6. // 'footer': { to: 'footer' }
7. }
8. });
79. Router.map(function () {
80. this.route('home', {
81. path : '/',
82. controller : HomeController
83. });
84. });
关于我做错了什么以及如何解决它的任何建议?
谢谢, 普拉尼
【问题讨论】:
-
您是否删除了 iron-router 包并重新安装?
-
谢谢,解决了!
标签: javascript meteor iron-router