I am facing a problem with my angularJS website that is built using the yeoman angular-fullstack generator. When I run grunt serve
, everything works perfectly fine. However, when I try to run grunt serve:dist
, I encounter this error:
grunt serve: dist -> Error: [$injector:unpr] Unknown provider: utilProvider <- util <- NavbarController
I have checked the dependency injection and am using inline injection. Below is the code for the controller:
'use strict';
(function () {
angular.module('fndParyBoatsApp')
.controller('NavbarController', ['$scope', 'util', 'dbService', '$state', '$mdMenu', '$stateParams', function ($scope, util, dbService, $state, $mdMenu, $stateParams) {
// Controller logic here
}]);
})();
This is the code for my util file:
'use strict';
(function(){
// Util code here
}());
And this is my grunt.js configuration:
// Grunt configuration here
I'm unable to pinpoint the exact cause of the issue. The inline injection should prevent minification issues, and I use util in other files without any problems.
If anyone has any insights or suggestions, it would be greatly appreciated!