title: AngularJS Error: Unknown provider: aProvider <- a
body: <p>OK I'm officially bald now, after having been streching my hair out with this infamous problem: The minfied AngularJS app just doesn't work, with this error thown out:</p>
  
  <blockquote>
    <p>Error: [$injector:unpr] Unknown provider: aProvider &lt;- a
    <a href="http://errors.angularjs.org/1.2.6/" rel="noreferrer">http://errors.angularjs.org/1.2.6/</a>$injector/unpr?p0=aProvider%20%3C-%20a
        at <a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:11492" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:11492</a>
        at <a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26946" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26946</a>
        at Object.c [as get] (<a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26250" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26250</a>)
        at <a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:27041" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:27041</a>
        at c (<a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26250" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26250</a>)
        at Object.d [as invoke] (<a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26496" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26496</a>)
        at <a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:9:910" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:9:910</a>
        at Object.f [as forEach] (<a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:11927" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:11927</a>)
        at <a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:9:856" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:9:856</a>
        at j (<a href="http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:5:27235" rel="noreferrer">http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:5:27235</a>)</p>
  </blockquote>
  
  <p>Lots of other people had this problem as well, but looks like it could be fixed by declaring dependencies as an array instead of bare function parameters, like this:</p>
  
  <pre><code>angular.module('my-app').controller('LoginCtrl', [ '$scope', 'HttpService', function($scope, HttpService) { ... }]);
  </code></pre>
  
  <p>instead of this:</p>
  
  <pre><code>angular.module('my-app').controller('LoginCtrl', function($scope, HttpService) { ... });
  </code></pre>
  
  <p>But it doesn't work in my case. I checked all of my scripts (coffee and generated javascripts as well), they all use the proper array-style declaration.</p>
  
  <p>The problem doesn't come from extra packages apparently. I tried moving all extra package references out of <code>&lt;!-- bower:js --&gt;</code> block (so that they are not minified by grunt), yet the problem still remains. Which means, it's my code to blame... But then again, I've tried the (seems to be) only fix available, to no avail.</p>
  
  <p>Any hint, even on how to properly debug this? </p>
  
  <p>Thanks in advance!</p>