2

Uncaught TypeError: angular.module(...).info is not a function

enter image description here

I installed angular-cookies from here: https://www.npmjs.com/package/angular-cookies via yarn: yarn add angular-cookies.

Added the dependency in my index like so:

<!-- build:vendors -->
<script src="assets/js/libs/vendors.min.js"></script>
<script src="../node_modules/angular-cookies/angular-cookies.js"></script>

<!-- endbuild -->
<!-- build:bundle-js -->
<script src="assets/js/tickertags.bundle.js"></script>
<!-- endbuild -->

Then added ngCookies inject in my app.js

"use strict";
module.exports = angular.module('tickertags', [
    'templateCache',
    'tickertags-tags',     // tags / tags_module.js
    'tickertags-tickers',  // tickers / tickers_module.js
    'ngCookies',
    'ui.mask',             // https://github.com/angular-ui/ui-mask
    'ui.router',           // https://github.com/angular-ui/ui-router
    'ui.bootstrap',        // https://github.com/angular-ui/bootstrap,
])

I also upgraded to angular 1.6.4 (from 1.5.4) and still running into this error.

Leon Gaban
  • 36,509
  • 115
  • 332
  • 529

2 Answers2

1

I was managing Angular via bower not NPM.

My bower version was ~1.5.9 and needed to bower install angular-cookies as well.

Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
  • I'm having the same issue but I am managing angular with NPM, do you think it would be safe to cut out that line from the ng-cookies module? – Andrew Clavin Apr 12 '17 at 21:34
  • There are 2 kinds of developers, one that would never change code in a plugin or library they are using, and one that would. I'm in the camp that would haha... however `NPM` is suppose to manage your backend dependancies and `Bower` your frontend, and Angular falls into the frontend category. – Leon Gaban Apr 13 '17 at 14:16
  • 1
    Figured out i just needed to rollback my angular-cookies to 1.5.8 as I couldn't update my angular with angular material on the project. – Andrew Clavin Apr 13 '17 at 17:05
1

Ensure that the angular-cookies version matches your angular version.

Chris Halcrow
  • 28,994
  • 18
  • 176
  • 206