Ngmessages Uncaught TypeError l.module(...).info is not a function

Ezequiel Ramiro picture Ezequiel Ramiro · Apr 14, 2017 · Viewed 8.2k times · Source

I've installed Angular-Messages to my Ionic V1 App but I cannot make it work.

Error:

Uncaught TypeError: l.module(...).info is not a function at angular-messages.js:267
at angular-messages.js:6

This is my index.html:

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>
    <script src="js/sha1.js"></script>

<script src="lib/ionic-material/dist/ionic.material.min.js"></script>
<script src="lib/angular-messages/angular-messages.min.js"></script>

and in my app.js

var app = angular.module('starter', ['ionic', 'ngCordovaOauth', 'ionic-material', 'ngMessages'])

Reading a bit I thought that could be a version problem between angular, angular-animate and angular-messages, which they have to be at the same version to be compatible.

Bower packages list - bower.json:

  "dependencies": {
    "ng-cordova-oauth": "^0.2.6",
    "angular": "~1.6.4",
    "angular-animate": "~1.6.4",
    "angular-messages": "~1.6.4"
  }

But nothing.. still getting the same error. What else could it be? Any ideas?

Thanks

Answer

Salix picture Salix · May 24, 2017

@larslemos' answer help me find the solution to my similar problem.

I was working with '.../libs/angular.js/1.6.1/angular.min.js'
but using '.../libs/angular-messages/1.6.4/angular-messages.min.js'.

Changing to angular 1.6.4 or ngMessages 1.6.1 did solved the issue.

So basically just make sure they are the same version, no need to go to 1.5.