Following is how my controller in Angular 1.x looks like -
const app = angular.module("userRegistration", [
"some-dep",
"templates",
"ngRoute",
"ngResource",
"ngCookies",
"userRegistration.controllers",
"userRegistration.services",
"userRegistration.directives"
]);
Everything runs fine but once in a while, the following error surfaces, mostly on a windows machine with Chrome browser version >= 62 -
Uncaught Error: [$injector:modulerr] Failed to instantiate module userRegistration due to: Error: [$injector:nomod] Module 'userRegistration' 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.
I came to know from another SO post that the issue lies in the syntax. The correct syntax is
var app = angular.module("MesaViewer", []);
But I am not sure why this error never sprang up in past. I tried to repro the issue on the same chrome browser version but was unable to.