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

前端 未结 5 830
暗喜
暗喜 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:37

    The way I solved the problem was by removing the 'use strict' that was above the jquery in the final minified script. Another way can be changing the jQuery version to one without the strict bug

    EDIT: After all it was a jQuery minification error on version 1.11, and an easy fix for this is to go to your Grunt file and comment out the line

    banner: "'use strict';\n"
    

提交回复
热议问题