0

Good morning,

I'm trying to deploy a sample angularjs project on Heroku but I get this error:

Uncaught Error: [$injector:unpr] Unknown provider: aProvider <- a

This is my Gruntfile.js:

grunt.registerTask('heroku:production', [
'clean:dist','wiredep','useminPrepare','concurrent:dist','autoprefixer','concat','ngmin',
'copy:dist','cdnify', 'cssmin','uglify', 'filerev', 'usemin:dist']);

All my controllers, services and providers are rewritten using this syntax:

var dett = angular.module('DettRipetizioniCtrlModule', []);

dett.controller('DettRipetizioniCtrl', [ '$scope', '$routeParams', '$location', 'services', function ($scope, $routeParams, $location, services) {
//do stuff
}

and my app.js file is:

var app = angular.module('lemieripetizioni3App',['ngRoute','ngAnimate','Services','DettRipetizioniCtrlModule','Animations','RicercaRipetizioniCtrlModule']);

This is my git repo: https://github.com/gterribilio/lmr.git

Any ideas? Could be a minification problem on Heroku? Using the same grunttask on localhost works fine.

Thanks in advance.

Giuseppe

1 Answers1

0

It is a minification issue, as you mentioned, and a really annoying one...

This post goes into great detail into the debugging part of the problem, it saved my life twice already :-)

"Unknown provider: aProvider <- a" How do I find the original provider?

Community
  • 1
  • 1
xShirase
  • 11,975
  • 4
  • 53
  • 85
  • Thanks for your reply! After many headaches I found the solution! I had in my app.js file .run(function($rootScope) { $rootScope.userData = {}; sessionStorage.isLogged=false; }); this piece of code in which I declared globally variables and Heroku didn't like it. Thanks for you help! Giuseppe – Giuseppe Terribilio Oct 07 '14 at 12:03