错误:路由器未定义V0.7.0 Meteor 0.8.0
Error: Router is not defined V0.7.0 Meteor 0.8.0
我刚更新到最新的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. });
有什么建议我做错了,如何解决它?
谢谢,Praney
对我来说,我有这个错误,iron-router
包从我的.meteor/packages
文件中丢失了。替换它,并做了一个mrt install
,它现在似乎工作。
尝试mrt install
,仍然有问题。
mrt add iron-router
帮我解决了
遵循以下答案可能会解决您的问题:
Meteor: App不支持0.9.1.1版本
做meteor remove iron-router
,然后meteor add iron:router
,这解决了我的问题。
相关文章:
- Meteor如何接收HTTP请求
- Meteor-将选定窗体中的对象添加到集合中
- Meteor上的启动页面
- Meteor方法在客户端返回null,在客户端运行的相同方法返回正确的值
- Meteor-添加用户自定义字段的方法不起作用
- Meteor忘记了密码的实现
- 链接所有<a>Meteor
- 在Meteor项目中安装并包含npm模块后出错
- Meteor JS中代码的重复使用部分
- Meteor Router数据函数被调用两次
- 基于localStorage的Meteor激活模板
- React+Meteor:this.ops返回未定义
- 如何将PHP get查询转换为Meteor's HTTP.get()
- 如何将javascript变量传递到Meteor Spacebars模板中
- 部署时使用npm包时发生Meteor错误
- Meteor如何运行服务器端python脚本
- 谷歌地图根本不适用于Meteor-iOS
- 无法在Meteor/MongoDB中返回当前用户对象
- Meteor:插入集合后如何执行JS
- 错误:路由器未定义V0.7.0 Meteor 0.8.0