Angular-Chart deployment issue - angularjs

Everything works fine locally but I just can't seem to work out what is going wrong when it is deployed.
It looks like something is missing but all the necessary files are there in the correct order:
bundles.Add(new ScriptBundle("~/bundles/angular").Include(
"~/Scripts/angular.js",
"~/Scripts/angular-resource.js",
"~/Scripts/angular-route.js",
"~/Scripts/angular-aria.min.js",
"~/Scripts/Chart.js",
"~/Scripts/angular-chart.js"
));
It keeps throwing the following error:
Error: [$injector:unpr] Unknown provider: nProvider <- n <- chartBarDirective
http://errors.angularjs.org/1.2.9/$injector/unpr?p0=nProvider%20%3C-%20n%20%3C-%20chartBarDirective
at http://xxxxxxxxxxxxxx/bundles/angular?
I'm not using a directive so this must be an Angular-Chart issue?
Any ideas?

Related

howtographql + React tutorial : Error: Cannot find module './generated/prisma.graphql'

I'm following the howtographql + React tutorial right now. I'm currently at the beginning of the tutorial when I have to define my queries, mutation and stuff in my schema.graphql. But according to the tutorial, I have to import prisma.graphql from the generatedfolder by writing the following line :
# import Link, Vote, LinkSubscriptionPayload, VoteSubscriptionPayload from "./generated/prisma.graphql"
I indeed generated the serverfolder which contains everything except this file that is supposed to be generated as well I guess.
Apparently, I should be able to run the server using yarn startbut when I'm doing so, I have this message :
Error: Cannot find module './generated/prisma.graphql'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
at resolveFileName (/Users/hamza/tfeScreen/reactapp/react-apollo/server/node_modules/resolve-from/index.js:29:39)
at resolveFrom (/Users/hamza/tfeScreen/reactapp/react-apollo/server/node_modules/resolve-from/index.js:43:9)
at module.exports (/Users/hamza/tfeScreen/reactapp/react-apollo/server/node_modules/resolve-from/index.js:46:41)
at resolveModuleFilePath (/Users/hamza/tfeScreen/reactapp/react-apollo/server/node_modules/graphql-import/dist/index.js:150:24)
at /Users/hamza/tfeScreen/reactapp/react-apollo/server/node_modules/graphql-import/dist/index.js:187:30
at Array.forEach (<anonymous>)
at collectDefinitions (/Users/hamza/tfeScreen/reactapp/react-apollo/server/node_modules/graphql-import/dist/index.js:185:16)
at Object.importSchema (/Users/hamza/tfeScreen/reactapp/react-apollo/server/node_modules/graphql-import/dist/index.js:73:14)
at mergeTypeDefs (/Users/hamza/tfeScreen/reactapp/react-apollo/server/node_modules/graphql-yoga/dist/index.js:412:37)
I don't understand what I'm doing wrong...
Do you guys have any idea ?

Angularjs - Unknown provider: $cordovaGeolocationProvider

I am trying to use $cordovaGeolocation but it give below error. Any one can help?
"Error: [$injector:unpr] Unknown provider: $cordovaGeolocationProvider <- $cordovaGeolocation <- GeoCtrl
I used sample in here
You seem to be missing a little setup. First, download ngCordova.js and include it in your index.html right before all your Angular scripts. Then, include the 'ngCordova' dependency when you declare your app module like this: angular.module('yourAppName', ['ngCordova', ...])

Grunt uglify fail while with JS Parse error

I've created an Angular app which works fine on locally.
However when I try to build (grunt build) to generate the dist folder that will contain my app with everything minified and ready to deploy, I have a error at the Uglify step.
Error:
JS_Parse_Error {
message: 'Unexpected token operator «=», expected punc «,»',
filename: '../../.tmp/concat/scripts/scripts.js',
...
I've read that people had similar errors, just the operator was a different one in the error message.
If someone has a clue.
My issue came from the function's parameters with a default value.
For example:
function (a = myValue, b) {
...
For some reason, giving that default value was not supported.
I replaced it by doing something like:
function (a, b) {
a = typeof a !== 'undefined' ? a : myValue;
...
You will find explanations of that behaviour by googling (uglify, ES6), I'm just offering the solution of my specific error.

Angular Unknown provider error: what's the meaning of the chain of functions, mentioned in error message?

I get an error from Angular:
angular.js:68 Uncaught Error: [$injector:unpr] Unknown provider: utilProvider <- util <- AuthInterceptor <- $http <- $templateFactory <- $view <- $state
I'm trying to localize the error, but I don't understand the meaning of chain of functions that the error message mensions:
utilProvider <- util <- AuthInterceptor <- $http <- $templateFactory <- $view <- $state
Can you explain, what are these guys? What's the order of them? It looks like a dependency stack, but is it right-to-left or left-to-right?
This error stack is to be read Left to Right.
It doesn't necessarily mean error is in the first object, it rather means error occured when trying to use that first object.
Angular generated error stack offers link to previous error, and you can trace your bug to its origin.
If you are developing in Chrome, the link is clickable in console and leads to Angular website where you can see some description of the error and most common causes.

cakephp app error problem

I have the following function in my app_controller:
function beforeFilter() {
$this->set('lastThreePosts', $this->Blog->find_latest_posts());
}
I then use the variable 'lastThreePosts' that I have set in my layout. This works fine apart from on my 404 page where I get the following error:
Notice (8): Undefined index: lastThreePosts [APP\views\layouts\default.ctp, line 29]
I have made my own 404 page by created the file error404.ctp in my /views/errors/ directory.
So it seems when theres a 404 error the code in the controller doesn't get executed. Does anyone know how I can make it work?
Thanks
Phew! I found the answer here:
http://www.bradezone.com/2009/05/21/cakephp-beforefilter-and-the-error-error/

Resources