5

When I turn on bundling everything bundles and minifies correctly except my angular.js file.

I get the following error:

"Minification failed. Returning unminified contents. (173,115-122): run-time error JS1019: Can't have 'break' outside of loop: break a"

However it seems to return a minified result and the site doesn't load.

I have tried updating the file to angular 1.5.8, and tried bundling the .min.js file but no success.

2
  • A couple of questions: (1) Could you post the resulting bundle? (2) How do you know minification is failing on angular.js and not on your custom JS code? Commented Sep 9, 2016 at 5:16
  • Same problem here, excluded all scripts from bundle one by one to identify the guilty one : angular.js is the one (minified or not, v1.5.8) Commented Mar 7, 2017 at 10:56

1 Answer 1

5

What I end up doing is just remove angular.min.js from project and let ASP bundling process to minimize angular.js and produce final minimized package.

Sometimes I had to do same trick with other JS libs (if my memory serves JQquery..)

Also in our solution we use .min.js files, but devs forget to regenerated this file from source and there were cases when release version had "fixed" but not fixed version of the file. I gave up fighting with this and just deleted all .min.js files. -))

Sign up to request clarification or add additional context in comments.

1 Comment

got the same problem with angular.js instead of angular.min.js, with version are you using?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.