title: AngularJS $injector error on force refresh
body: <p>I'm using AngularJS 1.6 with webpack. </p>
  
  <p>When I force a refresh in Chrome (Shift+F5) my app fails to bootstrap and I get the following error:</p>
  
  <pre><code>app-a1677133c4.js:101030Uncaught TypeError: Cannot read property 'substr' of null
      at app-a1677133c4.js:101030
      at app-a1677133c4.js:101030
      at Object.&lt;anonymous&gt; (app-a1677133c4.js:101030)
      at Object.&lt;anonymous&gt; (app-a1677133c4.js:101031)
      at __webpack_require__ (app-a1677133c4.js:20)
      at app-a1677133c4.js:116
      at Object.&lt;anonymous&gt; (app-a1677133c4.js:289)
      at __webpack_require__ (app-a1677133c4.js:20)
      at Object.&lt;anonymous&gt; (app-a1677133c4.js:47)
      at __webpack_require__ (app-a1677133c4.js:20)
  (anonymous) @ app-a1677133c4.js:101030
  (anonymous) @ app-a1677133c4.js:101030
  (anonymous) @ app-a1677133c4.js:101030
  (anonymous) @ app-a1677133c4.js:101031
  __webpack_require__ @ app-a1677133c4.js:20
  (anonymous) @ app-a1677133c4.js:116
  (anonymous) @ app-a1677133c4.js:289
  __webpack_require__ @ app-a1677133c4.js:20
  (anonymous) @ app-a1677133c4.js:47
  __webpack_require__ @ app-a1677133c4.js:20
  (anonymous) @ app-a1677133c4.js:40
  (anonymous) @ app-a1677133c4.js:43
  app-a1677133c4.js:11195 Uncaught Error: [$injector:modulerr] Failed to instantiate module scheduleApp due to:
  Error: [$injector:nomod] Module 'scheduleApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
  http://errors.angularjs.org/1.6.1/$injector/nomod?p0=scheduleApp
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13310:18
      at ensure (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13234:39)
      at module (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13308:15)
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15863:23
      at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
      at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
      at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
      at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
      at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
  http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=scheduleApp&amp;p1=Erro…host%3A5000%2Fstatic%2Fscheduling-angular%2Fapp-a1677133c4.js%3A12986%3A13)
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13310:18
      at ensure (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13234:39)
      at module (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:13308:15)
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15863:23
      at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
      at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
      at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
      at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
      at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
  http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=scheduleApp&amp;p1=Erro…host%3A5000%2Fstatic%2Fscheduling-angular%2Fapp-a1677133c4.js%3A12986%3A13)
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11195:13
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15886:16
      at forEach (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:11484:21)
      at loadModules (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15847:6)
      at createInjector (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:15769:20)
      at doBootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12965:21)
      at bootstrap (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12986:13)
      at angularInit (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:12871:6)
      at http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:44104:6
      at HTMLDocument.trigger (http://localhost:5000/static/scheduling-angular/app-a1677133c4.js:14441:6)
  </code></pre>
  
  <p>The app is called "scheduleApp" - the module that fails to load and is referenced in the above error.</p>
  
  <p>On a second normal refresh (ctr+r) everything works fine.</p>
  
  <p>I'm not really sure how to debug this. Any thoughts?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Turns out it was the AdGuard plugin I had installed in Chrome. Disabling the plugin for my site solved the issue.</p>
  
  <p>It would be nice to understand the possible reasons for <em>why</em> my app was being disrupted by the plugin, for example whether there is something going on internally in my app that is against best practices causing AdGuard to label it as suspicious, or perhaps this is just an idiosyncrasy of AdGuard. Unfortunately AdGuard provides no insights into this - it does not actually report any blocking activity.</p>