Angular - Module 'angulike' is not available! Error - don't know why? - angularjs

I am trying to use angulike and have included it in my dependencies. I am also using gulp so there can't be a loading /script issue.
I keep getting the error:
[$injector:modulerr] Failed to instantiate module FullstackGeneratedApp due to:
Error: [$injector:modulerr] Failed to instantiate module angulike due to:
Error: [$injector:nomod] Module 'angulike' 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.
If I 'move' 'angulike' to the end, I sometimes get the same error but it says 'fsaPreBuilt' is not available instead..Its so frustrating and I don't know why this is happening!
window.app = angular.module('FullstackGeneratedApp', ['fsaPreBuilt', 'angulike', 'ui.router', 'ui.bootstrap', 'ngAnimate', 'ui.materialize', 'angular-input-stars', 'angular-stripe']);

Related

Angular JS angular.js:116 Uncaught Error: [$injector:modulerr]

Hello i am getting this following error in angular js after uploading my code in staging. my code is working fine on local and ngrok also
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module pascalprecht.translate due to:
Error: [$injector:nomod] Module 'pascalprecht.translate' 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.
Please help
maybe in your staging server, you didn't install a language translation file.Please check
Thanks

Failed to instantiate module angular-jwt due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

In an AngularJS I'm trying to instantiate angular-jwt. But it fails,
although I have in my app.js file:
angular.module('xxx', ['ngRoute', 'angular-jwt'])
.config(config).run(run);
and in my index.html:
...
<script src="node_modules/angular-route/angular-route.js"></script>
<script src="node-modules/angular-jwt/dist/angular-jwt.js"></script>
<script src="angular-app/app.js"></script>
...
Chrome gives the usual error:
Failed to instantiate module xxx due to:
Error: [$injector:modulerr] Failed to instantiate module angular-jwt due to:
Error: [$injector:nomod] Module 'angular-jwt' 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.
Firefox is pointing to the real reason? It says:
The resource from “http://localhost:3000/node-modules/angular-jwt/dist/angular-jwt.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
Error: [$injector:modulerr] Failed to instantiate module meanhotel due to:
[$injector:modulerr] Failed to instantiate module angular-jwt due to:
[$injector:nomod] Module 'angular-jwt' 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.
The version of angular-jwt is angular-jwt#0.1.11.
Why is it thinking angular-jwt.js is text/html?
Path problem, I wrote node-modules, when it should be node_modules.

karma unit test running issue Error $injector:modulerr failed to instantiate module

I'm new to angularJS unit testing and I have added a new unit test but I'm running into this issue:
Error: [$injector:modulerr] Failed to instantiate module FeeBuddy due to:
Error: [$injector:modulerr] Failed to instantiate module ngMaterial due to:
Error: [$injector:nomod] Module 'ngMaterial' 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.
this is my karma.conf.js file dependecies call :
files: [
'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'node_modules/angular-ui-router/release/angular-ui-router.js',
//'node_modules/angular-material/angular-material.js',
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.js',
'public/js/vendor/materialPreloader.min.js',
'js/server.config.js',
'js/main.controller.js',
'js/controllers/*.js',
'js/services/*.js',
'js/directives/*.js',
'js/factories/*.js',
'js/components/*.js',
'js/modules/**/*.js',
'js/routes.js',
'js/modules.js',
'js/module.js',
'js/filters/*.js',
'js/modules/**/module.js',
'js/dependecies.js',
'test/unit/*.js'
],
Even if I uncomment the node_modules/angular-material/angular-material.js still i have the same issue

Mocking angular modules to pass karma testing

I recently implemented flash messages into my controller which has led to all of my karma tests failing. I saw another post suggested making a fake module and injecting that in but it does not seem best practice.
Is there a simple way of mocking 'angular-flash' from my controller?
edit:
this is the start of the stack error:
Error: [$injector:modulerr] Failed to instantiate module ShopTill due to:
Error: [$injector:modulerr] Failed to instantiate module flash due to:
Error: [$injector:nomod] Module 'flash' 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.
http://errors.angularjs.org/1.4.0/$injector/nomod?p0=flash
at /Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:1955
at ensure (/Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:1877)
at module (/Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:2192)
at /Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:4338
at forEach (/Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:336)
at loadModules (/Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:4364)
at /Users/edobrien/Documents/proj
but it works when I look on localhost, so it must be an issue with the test.... any help?

Angular 1.2.x console error messages

I just noticed strange look of error messages in Angular 1.2.16 (and 1.3 beta also):
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.16/$injector/
modulerr?p0=myapp&p1=Error%3A%…g%2F1.2.16
%2F%24injector%2Fnomod%3Fp0%3Dmyapp%0A%20%20%20%20at%20
Error%20(...<omitted>...1)
Instead of the ones in 1.2.1:
Uncaught Error: [$injector:modulerr] Failed to instantiate module myapp due to:
Error: [$injector:nomod] Module 'myapp' is not available!
You either misspelled the module name or forgot to load it.
If registering a module ensure that you specify th...<omitted>...0)
Anyone sees the same problem?
It is just a cause of minified version.

Resources