2014-03-29 62 views
1

我剛剛更新鐵路由器到最新的0.7.0,並有錯誤。錯誤:路由器未定義V0.7.0流星0.8.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

+1

您是否刪除了鐵路由器包並重新安裝? –

+0

謝謝,修好了! – praneybehl

回答

1

對於我來說,我有這個錯誤,並且iron-router包是從我.meteor/packages文件丟失。取代它,並做了mrt install,它現在似乎工作。

0

試過mrt install,仍然有問題。

mrt add iron-router幫我解決了。