我的Jquery脚本崩溃了heroku app,适用于localhost sails

时间:2016-04-27 14:13:24

标签: jquery heroku sails.js uglifyjs

我有一个我在计算机上用sailsjs创建的应用程序。 当tring将其上传到heroku服务器时,我得到与uglifying(production.js)相关的错误。 这些来自papertrail插件:链接到papertrail:https://papertrailapp.com/systems/friendlinew/events?r=661978136430596096-661995019569549312

  
    

丑化源.tmp / public / concat / production.js失败。       警告:丑化失败。       意外的令牌:运营商(>)       .tmp / public / concat / production.js中的第21196行

  
Aborted due to warnings. 
Running "uglify:dist" (uglify) task 
JS_Parse_Error { 
message: 'Unexpected token: operator (>)', 
filename: '../concat/production.js', 
line: 21196, 
col: 22, 
pos: 1312332, 

stack:'错误\ n在新的JS_Parse_Error(eval at(/app/node_modules/uglify-js/tools/node.js:22:1),:1526:18)\ n在js_error(eval) at(/app/node_modules/uglify-js/tools/node.js:22:1),: 1534:11)\ n at croak(eval at(/app/node_modules/uglify-js/tools/node.js: 22:1),:2026:9)\ n在token_error(eval at(/app/node_modules/uglify-js/tools/node.js:22:1),:2034:9)\ n出乎意料(eval at (/app/node_modules/uglify-js/tools/node.js:22:1),:2040:9)\ n在expr_atom(eval at(/app/node_modules/uglify-js/tools/node.js:22) :1),:2554:9)\ n在maybe_unary(eval at(/app/node_modules/uglify-js/tools/node.js:22:1),:2716:19)\ n在expr_ops(eval at( /app/node_modules/uglify-js/tools/node.js:22:1),:2751:24)\ n在maybe_conditional(eval at(/app/node_modules/uglify-js/tools/node.js:22: 1),:2756:20)\ n在maybe_assign(eval at(/app/node_modules/uglify-js/tools/node.js:22:1),:2780:20)' }

当我在localhost上运行脚本时,脚本运行正常。 我的代码:

function makeProgressLine(id,percent) {     
 itemz = document.getElementById(id);
 var bar = new ProgressBar.Line(itemz, {
  strokeWidth: 4,
  easing: 'easeInOut',
  duration: 1400,
  color: '#FFEA82',
  trailColor: '#eee',
  trailWidth: 1,
  svgStyle: {width: '100%', height: '100%'},
  text: {
    style: {
      // Text color.
      // Default: same as stroke color (options.color)
      color: '#999',
      position: 'absolute',
      right: '0',
      top: '30px',
      padding: 0,
      margin: 0,
      transform: null
    },
    autoStyleContainer: false
  },
  from: {color: '#00ff00'},
  to: {color: '#ED6A5A'},
  step: (state, bar) => {
      bar.path.setAttribute('stroke', state.color);
      bar.setText(Math.round(bar.value() * 100) + ' %');
  }
});

bar.animate(percent);
}   

function makeProgressCircle(id,percent) {     
    itemz = document.getElementById(id);
    var day = new ProgressBar.Circle(itemz, {
    color: '#aaa',
    // This has to be the same size as the maximum width to
    // prevent clipping
    strokeWidth: 4,
    trailWidth: 1,
    easing: 'easeInOut',
    duration: 1400,
    text: {
        autoStyleContainer: false
    },
    from: { color: '#f0f', width: 1 },
    to: { color: '#333', width: 4 },
    // Set default step function for all animate calls
    step: function(state, circle) {
        circle.path.setAttribute('stroke', state.color);
        circle.path.setAttribute('stroke-width', state.width);

        var value = Math.round(circle.value() * 100);
        if (value === 0) {
        circle.setText('');
        } else {
        circle.setText(value);
        console.log(value);
        }

    }
    });
//day.text.style.fontFamily = '"Raleway", Helvetica, sans-serif';
//day.text.style.fontSize = '2rem';

day.animate(percent);  // Number from 0.0 to 1.0
}

$(document).ready(function () { 
    makeProgressCircle('container',0.8);
    for (i=1;i<6;i++) {
       makeProgressLine('progress' + i,i*0.2); 
    }


});

0 个答案:

没有答案