2015-09-27 102 views
4

我正在使用Meteor的0.9.3.1版本開展一個項目。我剛剛升級到版本1.2.0.1,以恢復我的項目。流星:模板助手中的異常:ReferenceError:Match is not defined

我已經通過運行meteor add alanning:roles安裝了流星角色的最新版本,因此應該是最新版本。我看過docs,但這並沒有什麼幫助。

任何人都對這個錯誤是什麼以及如何解決它有任何想法?

Exception in template helper: ReferenceError: Match is not defined 
    at Object.Roles._uiHelpers.isInRole (http://localhost:3000/packages/alanning_roles.js?0f20b892d4a0a11a6ea8431da3d0a0953ba951a9:809:10) 
    at bindDataContext (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:2986:16) 
    at Blaze._wrapCatchingExceptions (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:1650:16) 
    at http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3038:66 
    at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3671:12) 
    at wrapHelper (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:3037:27) 
    at Spacebars.call (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:167:18) 
    at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:104:25) 
    at Object.Spacebars.dataMustache (http://localhost:3000/packages/spacebars.js?1aedcc2aa3ae9ff5d860d73516110cedd77c033e:136:39) 
    at http://localhost:3000/app/client/layout/adminlayout.compiled.html.js?c582d42dde65584f4e6c48e70d8d65fa2cba7589:6:22 
+0

'流星添加check'? – challett

+1

通常當我看到一個神祕的錯誤這樣我設置在封裝代碼中設置斷點('alanning_roles.js'線809),然後看看,看看它在做什麼以及它可能期待。大多數情況下,這會導致我自己代碼中的錯誤,但有時會導致在包中找到一個錯誤,在這種情況下,我會將它報告給gitHub上的作者。 –

+0

升級到1.2包後應爲使用預裝的包被宣告新的依賴。在這種情況下,'alanning:roles'需要聲明'check'。我已向回購協議提交了拉取請求,但似乎並不十分活躍。 – challett

回答

1

challett似乎已經修復了這個問題:

https://github.com/challett/meteor-roles/commit/dfd967e1e2ea27dc20b34e2bd17f38de70ebed72

//roles/package.js 

Package.describe({ 
    summary: "Authorization package for Meteor", 
- version: "1.2.12", 
+ version: "1.2.13", 
    git: "https://github.com/alanning/meteor-roles.git", 
    name: "alanning:roles" 
}); 
@@ -8,7 +8,7 @@ Package.describe({ 
Package.on_use(function (api) { 
    api.versionsFrom && api.versionsFrom("[email protected]"); 
    var both = ['client', 'server']; 
- api.use(['underscore', 'accounts-base'], both); 
+ api.use(['underscore', 'accounts-base', 'check'], both); 
    api.use(['handlebars'], 'client', {weak: true}); 
8

我相信this open issue在GitHub上對alanning:roles有您正在尋找的線索。您可能需要安裝check軟件包,因爲它可能是未聲明的依賴項。

$ meteor add check 
+0

謝謝同樣的事情,我沒有安裝但遺憾的是它並沒有幫助:( – user1532669

+0

我在Windows 10和它的工作像魅力謝謝 –