Skip to content Skip to sidebar Skip to footer

Unable To Instantiate Module On Production

I just pushed my program onto heroku and the page I had testing angular loaded with the following error: Uncaught Error: [$injector:modulerr] Failed to instantiate module diceAngu

Solution 1:

My strong suspicion, based upon the fact that Angular is looking for a provider for the variable t and I am guessing you would not name a service/controller/etc. t is that you're using minification/compiler somewhere that is clobbering your variables.

To get around this and be safe with a compiler, you need to adjust your syntax. Full details here but the skinny is below.

myapp.config(['$routeProvider', function($routeProvider) {
  $routeProvider.when('hello/:queryId', {
    templateUrl: 'mypartial.html',
    controller: MyCtrl,
    controllerAs: 'myCtrl',
    resolve: {
      'myParam': ['myService', '$route', function(myService, $route) {
        return myService.get($route.current.params.queryId);
      }]
    }
  });

Post a Comment for "Unable To Instantiate Module On Production"