ngAnnotate - Warning: StringMap expected string key

iss42 picture iss42 · Aug 31, 2017 · Viewed 7.7k times · Source

I get this warning when using Grunt and grunt-ng-annotate.

There is no reference in the warning to where the error is in the file, which makes debugging it hard.

Any ideas?

Answer

iss42 picture iss42 · Aug 31, 2017

The issue turned out to be use of ES6 notation, in this case arrow functions (=>), default parameters and let.

I haven't looked in detail as to why ngAnnotate doesn't support this.

To find where the issues were I overrode the ngAnnotate warning with grunt switch --force and later in the build uglify complained about the ES6 syntax with more detail.