javascriptangularjsgruntjs

What does it mean when ngAnnotate says "Cannot create property '$methodName'..."


I am in a bad situation. I need to make some small changes to a complex web application that I did not write myself. However, to begin with I cannot even get the application to build.

The project is using grunt to build the application. But when I run it I get the following error:

Running "ngAnnotate:dist" (ngAnnotate) task
Warning: Cannot create property '$methodName' on boolean 'false' Use --force to continue.

Aborted due to warnings.

Does anyone have a clue what this means and how I can fix it?

Note: If I run grunt --force it does complete building but the result looks all weird and is not functional.

I should probably add that I am pretty unfamiliar with web development, including with grunt.


Solution

  • There was some issue with older ngAnnotate package. grunt-ng-annotate depends on ngAnnotate. So you will have to update the grunt-ng-annotate package. You can do so using "update grunt-ng-annotate" command in your project directory or by changing version to latest version in package.json then run npm install

    Here is the link for the issue: https://github.com/olov/ng-annotate/issues/139