Swiip / generator-gulp-angular

Yeoman generator for AngularJS with GulpJS [UNMAINTAINED next iteration is FountainJS]
http://fountainjs.io
3.72k stars 664 forks source link

Error when running build version #667

Closed thangtx closed 9 years ago

thangtx commented 9 years ago

Hi I have problem with running this app on production, test with gulp serve run fine but when I use gulp build it cause error:

Failed to instantiate module angulartics due to: Error: [$injector:nomod] Module 'angulartics' 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.4.1/$injector/nomod?p0=angu... at http://localhost:5000/scripts/vendor-44b1079334.js:32:380 at http://localhost:5000/scripts/vendor-44b1079334.js:32:9699 at e (http://localhost:5000/scripts/vendor-44b1079334.js:32:9172) at e (http://localhost:5000/scripts/vendor-44b1079334.js:32:9484) at http://localhost:5000/scripts/vendor-44b1079334.js:32:18312 at o (http://localhost:5000/scripts/vendor-44b1079334.js:32:787) at d (http://localhost:5000/scripts/vendor-44b1079334.js:32:18090) at http://localhost:5000/scripts/vendor-44b1079334.js:32:18259 at o (http://localhost:5000/scripts/vendor-44b1079334.js:32:787) at d (http://localhost:5000/scripts/vendor-44b1079334.js:32:18090

My module file:

(function() {
  'use strict';

  angular
    .module('jamja', ['ngAnimate', 'ngCookies', 'ngTouch', 'ngSanitize', 'ngResource', 'ui.router', 'ui.bootstrap','ngResourceTastypie', 'angular-storage', 'facebook', 'angularMoment','uiGmapgoogle-maps','infinite-scroll','angulartics', 'angulartics.google.analytics']);

})();
Swiip commented 9 years ago

By "this app" you mean "your app" started with the generator and with 10 more external libraries. It's not very fair.

This problem is obviously an strict injection problem, the minification change variables names and the automatic injection stop working. The generator comes with ngAnnotate but it happens it misses something. Try commenting the uglify transformation and add ngStringDi (https://docs.angularjs.org/api/ng/directive/ngApp) to locate the problem.

thangtx commented 9 years ago

Thank you, my issue is resolved.

naveenjafer commented 8 years ago

@thangtx I am facing the same issue! Did just removing the uglify transformation work? doing that is still not fixing my issue.