Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.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
Javascript 流星错误:无此功能:仅在生产模式下_Javascript_Jquery_Meteor - Fatal编程技术网

Javascript 流星错误:无此功能:仅在生产模式下

Javascript 流星错误:无此功能:仅在生产模式下,javascript,jquery,meteor,Javascript,Jquery,Meteor,我的应用程序在调试模式下运行良好,但在生产模式下运行时,我得到: 错误:没有这样的函数:canAddMore 以下是我的JS代码: Template.fbRegister.helpers({ jobCount: function() { return Session.get("jobCount"); }, eduCount: function() { return Session.get("eduCount"); },

我的应用程序在调试模式下运行良好,但在生产模式下运行时,我得到:

错误:没有这样的函数:canAddMore

以下是我的JS代码:

Template.fbRegister.helpers({
    jobCount: function() {
        return Session.get("jobCount");
    },

    eduCount: function() {
        return Session.get("eduCount");
    },

    moreThanOneJob: function() {
        return Session.get('jobCount').length > 1
    },

    moreThanOneEdu: function() {
        return Session.get('eduCount').length > 1
    },

    canAddMore: function(count) {
        console.log(count)
        return count.length <= 2
    },
});
Template.fbRegister.helpers({
作业计数:函数(){
返回会话。获取(“作业计数”);
},
eduCount:function(){
return Session.get(“eduCount”);
},
不止一个作业:函数(){
返回会话。获取('jobCount')。长度>1
},
不止一个edu:function(){
返回会话。get('eduCount')。长度>1
},
卡纳德莫尔:函数(计数){
console.log(计数)

return count.length由于几个缺少分号,您的代码可能在生产过程中中断。部署Meteor应用程序时,您的代码将缩小。在此过程中,将删除空行,因此无法再区分语句何时结束

请尝试:

Template.fbRegister.helpers({
    jobCount: function () {
        return Session.get("jobCount");
    },
    eduCount: function () {
        return Session.get("eduCount");
    },
    moreThanOneJob: function () {
        return Session.get('jobCount').length > 1;
    },
    moreThanOneEdu: function () {
        return Session.get('eduCount').length > 1;
    },
    canAddMore: function (count) {
        console.log(count);
        return count.length <= 2;
    }
});
Template.fbRegister.helpers({
作业计数:函数(){
返回会话。获取(“作业计数”);
},
eduCount:函数(){
return Session.get(“eduCount”);
},
不止一个作业:函数(){
返回会话.get('jobCount')。长度>1;
},
不止一个EDU:函数(){
返回会话.get('eduCount')。长度>1;
},
卡纳德莫尔:函数(计数){
控制台日志(计数);

return count.length感谢Matthias的建议。早些时候有人提出了这个建议,我检查了所有JS文件以修复我丢失的所有分号。它没有起到作用。因此我从头开始重新启动应用程序,在生产模式下运行它,并在出现问题时进行修复。目前为止一切正常。
Template.fbRegister.helpers({
    jobCount: function () {
        return Session.get("jobCount");
    },
    eduCount: function () {
        return Session.get("eduCount");
    },
    moreThanOneJob: function () {
        return Session.get('jobCount').length > 1;
    },
    moreThanOneEdu: function () {
        return Session.get('eduCount').length > 1;
    },
    canAddMore: function (count) {
        console.log(count);
        return count.length <= 2;
    }
});