title: AngularJS Uncaught Error: $injector:modulerr
body: <p>I know there are a million of these questions, and I've been coding with AngularJS for a while, but this one is unusual.</p>
  
  <p>2 weeks ago I deployed a website for a client and everything was working beautifully. Then the client decided he wants a small change, so before making the changes I ran the website on a local server just to make sure everything is ok.</p>
  
  <p>Then this error pops up... I have no clue what it means, and I haven't made any changes to the code. It's the same as the deployed site which runs perfectly. Would anyone know what this error means by any chance?</p>
  
  <pre><code>Failed to instantiate module crsportal due to:
  Error: [$injector:modulerr] http://errors.angularjs.org/1.5.7/$injector/modulerr?p0=c...)
      at Error (native)
      at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:6:412
      at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:40:134
      at r (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:7:355)
      at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:39:222)
      at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:39:391
      at r (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:7:355)
      at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:39:222)
      at db (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:43:246)
      at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:20:359
  </code></pre>
  
  <p>I can give you the code, because perhaps I changed something without realizing it.</p>
  
  <p><strong>crsportal.js</strong></p>
  
  <pre><code>(function () {
    'use strict';
  
    angular
      .module('crsportal', [
        'crs.authentication',
        'crs.config',
        'crs.routes',
        'crs.profiles.controllers',
        'profile.services',
        'route.controller'
      ]);
  
    angular
      .module('crs.config', []);
  
    angular
      .module('crs.profiles.controllers', []);
  
    angular
      .module('crs.routes', ['ngRoute']);
  
    angular
      .module('profile.services', []);
  
    angular
      .module('route.controller', []);
  
    angular
      .module('crsportal')
      .run(run);
  
    run.$inject = ['$http'];
  
      /**
      * @name run
      * @desc Update xsrf $http headers to align with Django's defaults
      */
    function run($http) {
        $http.defaults.xsrfHeaderName = 'X-CSRFToken';
        $http.defaults.xsrfCookieName = 'csrftoken';
      }
  
  })();
  </code></pre>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;CRS Client Portal&lt;/title&gt;
  
    &lt;base href="/" /&gt;
  
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
  
    &lt;!-- The HTML5 Shim is required for older browsers, mainly older versions IE --&gt;
      &lt;!--[if lt IE 9]&gt;
          &lt;script src="http://html5shim.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;
      &lt;![endif]--&gt;
    &lt;!--[if lt IE 7]&gt;
      &lt;div style=' clear: both; text-align:center; position: relative;'&gt;
          &lt;a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"&gt;&lt;img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" alt="" /&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;![endif]--&gt;
  
    &lt;script&gt;
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  
        ga('create', 'UA-84093208-1', 'auto');
        ga('send', 'pageview');
      &lt;/script&gt;
    {% include 'stylesheets.html' %}
    &lt;!-- Latest compiled and minified CSS --&gt;
    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
  &lt;/head&gt;
  
  &lt;body ng-app="crsportal" class="loginpage"&gt;
    &lt;div class="container-fluid" ng-controller="LoginController as vm"&gt;
        {% include 'login.html' %}
    &lt;/div&gt;
  
    {% include 'javascripts.html' %}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Edit: Added Info</strong></p>
  
  <p><strong>authentication.module.js</strong></p>
  
  <pre><code>(function () {
    'use strict';
    angular
      .module('crs.authentication', [
        'authentication.controllers',
        'authentication.services'
      ]);
  
    angular
      .module('authentication.controllers', []);
  
    angular
      .module('authentication.services', ['ngCookies']);
  })();
  </code></pre>
  
  <p><strong>javascripts.html</strong></p>
  
  <pre><code>&lt;script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'bower_components/bootstrap-material-design/dist/js/material.js' %}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'bower_components/bootstrap-material-design/dist/js/ripples.js' %}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'bower_components/underscore/underscore.js' %}"&gt;&lt;/script&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular-route.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular-cookies.js"&gt;&lt;/script&gt;
  
  
  &lt;script type="text/javascript" src="{% static 'bower_components/ngDialog/js/ngDialog.js' %}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'lib/snackbarjs/snackbar.min.js' %}"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" src="{% static 'javascripts/crsportal.js' %}"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" src="{% static 'javascripts/config.js' %}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'javascripts/routes.js' %}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'javascripts/authentication/authentication.module.js' %}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'javascripts/authentication/services/authentication.services.js' %}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'javascripts/authentication/controllers/login.controller.js' %}"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="{% static 'javascripts/authentication/controllers/logout.controller.js' %}"&gt;&lt;/script&gt;
  </code></pre>