Error: $injector:modulerr Module Error - I can’t fix

Asked

Viewed 661 times

1

I’ve been fighting with this mistake for a long time and I can’t find a solution, I’m counting on someone to help me please.

Unique file. For unsuccessful testing.

    <html lang="en">
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">


  <!-- Angular Material requires Angular.js Libraries -->
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/angular-ui-router/1.0.0-rc.1/angular-ui-router.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-route.js"></script>

   <!-- Angular Material style sheet -->
  <link rel="stylesheet" src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">






  <style>
  .menuBardemoBasicUsage .page-container {
  padding: 32px; }

.menuBardemoBasicUsage .page {
  margin: 0 auto;
  padding: 24px;
  max-width: 680px;
  box-shadow: 0px 1px 2px 1px rgba(0, 0, 0, 0.25); }

.menuBardemoBasicUsage .page h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-top: 0;
  font-weight: normal; }

.menuBardemoBasicUsage .page p {
  line-height: 1.6rem; }


/*
Copyright 2016 Google Inc. All Rights Reserved. 
Use of this source code is governed by an MIT-style license that can be foundin the LICENSE file at http://material.angularjs.org/HEAD/license.
*/


  </style>

</head>
<body ng-cloak>

  <!--
    Your HTML content here
  -->  

  ssssssssssssssssss




  <div ng-controller="DemoBasicCtrl as ctrl" ng-cloak="" class="menuBardemoBasicUsage" ng-app="MyApp" >
  <md-toolbar class="md-menu-toolbar">
    <div layout="row">
      <md-toolbar-filler layout="" layout-align="center center">
        <md-icon md-svg-icon="call:chat"></md-icon>
      </md-toolbar-filler>

      <div>
        <h2 class="md-toolbar-tools">Untitled document</h2>
        <md-menu-bar>
          <md-menu>
            <button ng-click="$mdMenu.open()">
              File
            </button>
            <md-menu-content>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('share', $event)">
                  Share...
                </md-button>
              </md-menu-item>
              <md-menu-divider></md-menu-divider>
              <md-menu-item>
                <md-menu>
                  <md-button ng-click="$mdMenu.open()">New</md-button>
                  <md-menu-content>
                    <md-menu-item><md-button ng-click="ctrl.sampleAction('New Document', $event)">Document</md-button></md-menu-item>
                    <md-menu-item><md-button ng-click="ctrl.sampleAction('New Spreadsheet', $event)">Spreadsheet</md-button></md-menu-item>
                    <md-menu-item><md-button ng-click="ctrl.sampleAction('New Presentation', $event)">Presentation</md-button></md-menu-item>
                    <md-menu-item><md-button ng-click="ctrl.sampleAction('New Form', $event)">Form</md-button></md-menu-item>
                    <md-menu-item><md-button ng-click="ctrl.sampleAction('New Drawing', $event)">Drawing</md-button></md-menu-item>
                  </md-menu-content>
                </md-menu>
              </md-menu-item>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('Open', $event)">
                  Open...
                  <span class="md-alt-text"> {{ 'M-O' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item>
                <md-button disabled="disabled" ng-click="ctrl.sampleAction('Rename', $event)">
                  Rename
                </md-button>
              </md-menu-item>
              <md-menu-divider></md-menu-divider>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('Print', $event)">
                  Print
                  <span class="md-alt-text">{{ 'M-P' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
            </md-menu-content>
          </md-menu>
          <md-menu>
            <button ng-click="$mdMenu.open()">
              Edit
            </button>
            <md-menu-content>
              <md-menu-item class="md-indent">
                <md-icon md-svg-icon="undo"></md-icon>
                <md-button ng-click="ctrl.sampleAction('undo', $event)">
                  Undo
                  <span class="md-alt-text">{{ 'M-Z' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item class="md-indent">
                <md-icon md-svg-icon="redo"></md-icon>
                <md-button ng-click="ctrl.sampleAction('redo', $event)">
                  Redo
                  <span class="md-alt-text">{{ 'M-Y' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-divider></md-menu-divider>
              <md-menu-item class="md-indent">
                <md-icon md-svg-icon="content-cut"></md-icon>
                <md-button ng-click="ctrl.sampleAction('cut', $event)">
                  Cut
                  <span class="md-alt-text">{{ 'M-X' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item class="md-indent">
                <md-icon md-svg-icon="content-copy"></md-icon>
                <md-button ng-click="ctrl.sampleAction('copy', $event)">
                  Copy
                  <span class="md-alt-text">{{ 'M-C' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item class="md-indent">
                <md-icon md-svg-icon="content-paste"></md-icon>
                <md-button ng-click="ctrl.sampleAction('paste', $event)">
                  Paste
                  <span class="md-alt-text">{{ 'M-P' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-divider></md-menu-divider>
              <md-menu-item class="md-indent">
                <md-button ng-click="ctrl.sampleAction('Find and replace', $event)">
                  Find and replace...
                  <span class="md-alt-text">{{ 'M-S-H' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
            </md-menu-content>
          </md-menu>
          <md-menu>
            <button ng-click="$mdMenu.open()">
              View
            </button>
            <md-menu-content>
              <md-menu-item type="checkbox" ng-model="ctrl.settings.printLayout">Print layout</md-menu-item>
              <md-menu-item class="md-indent">
                <md-menu>
                  <md-button ng-click="$mdMenu.open()">Mode</md-button>
                  <md-menu-content width="3">
                    <md-menu-item type="radio" ng-model="ctrl.settings.presentationMode" value="'presentation'">Presentation</md-menu-item>
                    <md-menu-item type="radio" ng-model="ctrl.settings.presentationMode" value="'edit'">Edit</md-menu-item>
                    <md-menu-item type="radio" ng-model="ctrl.settings.presentationMode" value="'modifiable'">Modifiable</md-menu-item>
                  </md-menu-content>
                </md-menu>
              </md-menu-item>
              <md-menu-divider></md-menu-divider>
              <md-menu-item type="checkbox" ng-model="ctrl.settings.showRuler">Show ruler</md-menu-item>
              <md-menu-item type="checkbox" ng-model="ctrl.settings.showEquationToolbar">Show equation toolbar</md-menu-item>
              <md-menu-item type="checkbox" ng-model="ctrl.settings.showSpellingSuggestions">Show spelling suggestions</md-menu-item>
              <md-menu-divider></md-menu-divider>
              <md-menu-item type="checkbox" ng-model="ctrl.settings.compactControls">Compact controls</md-menu-item>
              <md-menu-item type="checkbox" ng-model="ctrl.settings.fullScreen">Full screen</md-menu-item>
            </md-menu-content>
          </md-menu>
          <md-menu>
            <button ng-click="$mdMenu.open()">
              Format
            </button>
            <md-menu-content>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('bold', $event)">
                  Bold
                  <span class="md-alt-text"> {{ 'M-B' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('italic', $event)">
                  Italic
                  <span class="md-alt-text">{{ 'M-I' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('underline', $event)">
                  Underline
                  <span class="md-alt-text">{{ 'M-U' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('strikethrough', $event)">
                  Strikethrough
                  <span class="md-alt-text">{{ 'A-S-5' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('superscript', $event)">
                  Superscript
                  <span class="md-alt-text">{{ 'M-.' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-item>
                <md-button ng-click="ctrl.sampleAction('subscript', $event)">
                  Subscript
                  <span class="md-alt-text">{{ 'M-,' | keyboardShortcut }}</span>
                </md-button>
              </md-menu-item>
              <md-menu-divider></md-menu-divider>
              <md-menu-item><md-button ng-click="ctrl.toggleSetting('clearFormatting')">Clear Formatting</md-button></md-menu-item>
            </md-menu-content>
          </md-menu>
        </md-menu-bar>
      </div>
    </div>
  </md-toolbar>

  <md-content class="page-container">
    <md-card class="page">
      <h1>Untitled document</h1>
      <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis consectetur purus sit amet fermentum. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p>
      <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Vestibulum id ligula porta felis euismod semper. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Nulla vitae elit libero, a pharetra augue. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
      <p>Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>
    </md-card>
  </md-content>
</div>

<!--
Copyright 2016 Google Inc. All Rights Reserved. 
Use of this source code is governed by an MIT-style license that can be foundin the LICENSE file at http://material.angularjs.org/HEAD/license.
-->





  <!-- Angular Material Library -->
  <script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>

  <!-- Your application bootstrap  -->
  <script type="text/javascript">    
    /**
     * You must include the dependency on 'ngMaterial' 
     */
    angular.module('MyApp',['ngRoute','ngMaterial', 'ngMessages', 'material.svgAssetsCache'])
  .config(function($mdIconProvider) {
    $mdIconProvider
      .defaultIconSet('img/icons/sets/core-icons.svg', 24);
  })
  .filter('keyboardShortcut', function($window) {
    return function(str) {
      if (!str) return;
      var keys = str.split('-');
      var isOSX = /Mac OS X/.test($window.navigator.userAgent);

      var seperator = (!isOSX || keys.length > 2) ? '+' : '';

      var abbreviations = {
        M: isOSX ? '' : 'Ctrl',
        A: isOSX ? 'Option' : 'Alt',
        S: 'Shift'
      };

      return keys.map(function(key, index) {
        var last = index == keys.length - 1;
        return last ? key : abbreviations[key];
      }).join(seperator);
    };
  })
  .controller('DemoBasicCtrl', function DemoCtrl($mdDialog) {
    this.settings = {
      printLayout: true,
      showRuler: true,
      showSpellingSuggestions: true,
      presentationMode: 'edit'
    };

    this.sampleAction = function(name, ev) {
      $mdDialog.show($mdDialog.alert()
        .title(name)
        .textContent('You triggered the "' + name + '" action')
        .ok('Great')
        .targetEvent(ev)
      );
    };
  });



/**
Copyright 2016 Google Inc. All Rights Reserved. 
Use of this source code is governed by an MIT-style license that can be foundin the LICENSE file at http://material.angularjs.org/HEAD/license.
**/







  </script>

  <script>

  (function() {
  'use strict';

   $rootScope.$on('$routeChangeSuccess', function(event, current) {
     $scope.currentLink = getCurrentLinkFromRoute(current);
   });
});


  </script>

</body>
</html>

Error triggered on console:

13:16:00.713 jquery.min.js:2 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=MyApp&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.5.5%2F%24injector%2Fmodulerr%3Fp0%3Dmaterial.svgAssetsCache%26p1%3DError%253A%2520%255B%2524injector%253Anomod%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.5.5%252F%2524injector%252Fnomod%253Fp0%253Dmaterial.svgAssetsCache%250A%2520%2520%2520%2520at%2520https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A6%253A412%250A%2520%2520%2520%2520at%2520https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A25%253A235%250A%2520%2520%2520%2520at%2520b%2520(https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A24%253A282)%250A%2520%2520%2520%2520at%2520https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A25%253A20%250A%2520%2520%2520%2520at%2520https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A39%253A374%250A%2520%2520%2520%2520at%2520q%2520(https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A7%253A355)%250A%2520%2520%2520%2520at%2520g%2520(https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A39%253A222)%250A%2520%2520%2520%2520at%2520https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A39%253A391%250A%2520%2520%2520%2520at%2520q%2520(https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A7%253A355)%250A%2520%2520%2520%2520at%2520g%2520(https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.5.5%252Fangular.min.js%253A39%253A222)%0A%20%20%20%20at%20https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A6%3A412%0A%20%20%20%20at%20https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A40%3A134%0A%20%20%20%20at%20q%20(https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A7%3A355)%0A%20%20%20%20at%20g%20(https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A39%3A222)%0A%20%20%20%20at%20https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A39%3A391%0A%20%20%20%20at%20q%20(https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A7%3A355)%0A%20%20%20%20at%20g%20(https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A39%3A222)%0A%20%20%20%20at%20bb%20(https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A43%3A246)%0A%20%20%20%20at%20c%20(https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A21%3A19)%0A%20%20%20%20at%20yc%20(https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.5.5%2Fangular.min.js%3A21%3A332)
    at angular.js:38
    at angular.js:4587
    at q (angular.js:322)
    at g (angular.js:4548)
    at bb (angular.js:4470)
    at c (angular.js:1746)
    at yc (angular.js:1767)
    at ee (angular.js:1652)
    at HTMLDocument.<anonymous> (angular.js:30863)
    at j (jquery.min.js:2)
(anonymous) @ angular.js:38
(anonymous) @ angular.js:4587
q @ angular.js:322
g @ angular.js:4548
bb @ angular.js:4470
c @ angular.js:1746
yc @ angular.js:1767
ee @ angular.js:1652
(anonymous) @ angular.js:30863
j @ jquery.min.js:2
k @ jquery.min.js:2
setTimeout (async)
r.readyException @ jquery.min.js:2
(anonymous) @ jquery.min.js:2
j @ jquery.min.js:2
k @ jquery.min.js:2
setTimeout (async)
(anonymous) @ jquery.min.js:2
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
fire @ jquery.min.js:2
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
k @ jquery.min.js:2
setTimeout (async)
(anonymous) @ jquery.min.js:2
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
fire @ jquery.min.js:2
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
ready @ jquery.min.js:2
S @ jquery.min.js:3
  • 1

    It seems you forgot to include the module script material.svgAssetsCache.

  • Our.... would never imagine even ... thank you very much for the guidance.. That was the problem anyway.. Could you tell me what you analyzed, according to the mistake I went through? And how do I put as solved here?

  • Yes, I can say. I will write an answer already saying this. To mark as solved, just click on V on the response side.

  • Did you manage to solve the problem? Need something else in the answer?

  • The problem has been solved ... Thank you all very much

  • You can mark the answer as correct using the V left-hand side =D

Show 1 more comment

1 answer

1

If you follow the giant link of your question, you will see a message like this

Failed to instantiate module MyApp due to: 
Error: [$injector:modulerr] http://errors.angularjs.org/1.5.5/$injector/modulerr?p0=m...)
 at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:6:412
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:40:134
at q (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:7:355)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:39:222)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:39:391
at q (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:7:355)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:39:222)
at bb (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:43:246)
at c (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:21:19)
at yc (https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js:21:332)

Following the subsequent links you will notice this message

Module 'material.svgAssetsCache' 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.

So you may notice that you forgot to include the module script material.svgAssetsCache.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.