Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Meteor:模板帮助程序中的异常:引用错误:未定义匹配_Meteor - Fatal编程技术网

Meteor:模板帮助程序中的异常:引用错误:未定义匹配

Meteor:模板帮助程序中的异常:引用错误:未定义匹配,meteor,Meteor,我正在使用Meteor的0.9.3.1版本进行一个项目。我刚刚升级到1.2.0.1版,以便恢复我的项目 我已经通过运行meteor add alanning:roles安装了meteor角色的最新版本,因此应该是最新的。我已经看过了,但这并没有真正起作用 有人知道这个错误是什么以及如何解决吗 Exception in template helper: ReferenceError: Match is not defined at Object.Roles._uiHelpers.isInR

我正在使用Meteor的0.9.3.1版本进行一个项目。我刚刚升级到1.2.0.1版,以便恢复我的项目

我已经通过运行meteor add alanning:roles安装了meteor角色的最新版本,因此应该是最新的。我已经看过了,但这并没有真正起作用

有人知道这个错误是什么以及如何解决吗

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
我相信在GitHub上反对alanning:roles有你想要的线索。您可能需要安装
check
软件包,因为它可能是一个未声明的依赖项

$ meteor add check

challett似乎已解决此问题:


meteor add check
?通常,当我看到这样一个神秘的错误时,我会在包代码(
alanning_roles.js
第809行)中设置一个断点,然后查看它在做什么以及它可能期望的是什么。这通常会导致我自己的代码中出现错误,但有时会导致在包中发现错误,在这种情况下,我会在gitHub上向作者报告错误。升级到1.2版后,包应该为以前预装的包声明新的依赖项。在这种情况下,
alanning:roles
需要声明
check
。我已经向repo提交了一个pull请求,但它似乎不是很活跃。哦,不:(……可能意味着重写我项目中的角色部分。你会推荐其他软件包做同样的事情吗?谢谢,我确实安装了它,但遗憾的是它没有帮助:(我在windows 10上,它工作得很好,谢谢
//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("METEOR@0.9.0");
   var both = ['client', 'server'];
-  api.use(['underscore', 'accounts-base'], both);
+  api.use(['underscore', 'accounts-base', 'check'], both);
   api.use(['handlebars'], 'client', {weak: true});