Injector:modulerrr error even a after adding ngRoute. AngularJs


I am having a hard time figuring out why I am still having this error:

angular.js:36 Uncaught Error: [$injector:modulerr]$injector/modulerr?p0=portalEncomiendasApp&

I have my index:

<html ng-app="portalEncomiendasApp">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no"/>
    <meta name="description" content="Portal Encomiendas Internacionales">
    <meta name="author" content="">
    <title>Portal Encomiendas Internacionales</title>
    <meta name="mobile-web-app-capable" content="yes">
    <base href="/">
    <link rel="stylesheet" href="//"/>
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="../css/style.css"/>

        <div ng-view></div>

    <script src=""></script>
    <script src=""></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../js/script.js"></script>

my script.js

var portalEncomiendasApp = angular.module('portalEncomiendasApp',

// configure our routes
portalEncomiendasApp.config(function ($locationProvider, $routeProvider) {



    .when('/', {
        templateUrl: 'pages/home/home.html',
        controller: 'mainController'
        .otherwise({ redirectTo: '/' });

And my home and main controller are empty so far.

What am I missing? I tried downloading the files, using the minified version and I also looked here:

Angularjs 1.2.x Injector:modulerrr error even a after adding ngRoute

And that it why I have that version of angular-route, but nothing worked so far.


Check this plunkr

I have made 3 changes to make it a working plunkr:

  1. I removed 'app.home.module' injection as it wasnt there in your module.
  2. For plunkr to run I added <base href="." />
  3. Changes script.js path

Tip: Try to use angular.js when in dev mode rather than angular.min.js, because a you get better readable error messages when you use non minified files. (which you certainly need in dev environment)

Answered By – Shashank Vivek

Answer Checked By – Willingham (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.