Uncaught SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function

前端 未结 5 785
暗喜
暗喜 2020-12-11 01:05

Hello when I run this project in Developer mode (grunt server) https://github.com/kennethlynne/generator-angular-xl everything is ok but when I run it in production mode (gr

5条回答
  •  囚心锁ツ
    2020-12-11 01:17

    As someone suggested above, you can uncomment the 'use strict'; part, or even better, change your function syntax

    instead of

    function funcName (param) { }
    

    use

    funcName = function(param) {}; 
    

提交回复
热议问题