0

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?

72GM
  • 2,926
  • 3
  • 27
  • 33
  • At what point are you loading your script that uses the angular-chart.js? – Shak Ham Jan 04 '16 at 17:13
  • all the scripts (eg the script bundles) are loaded before the page that has the canvas item. the error occurs when the the page is loaded and tries to draw the canvas... I have stepped through it and checked... – 72GM Jan 04 '16 at 18:16
  • I have no idea where chartBarDirective is held as it isn't in any of the scripts or files – 72GM Jan 04 '16 at 18:18
  • I'm not sure what's going on. Maybe you have the wrong version or something. Here's a plunkr that shows everything is working fine when everything is setup properly: https://plnkr.co/edit/g4EhJdPESkjuLlKivbrV?p=preview – Shak Ham Jan 04 '16 at 19:33
  • yeah i can get it to work fine but it just doesn't work when I deploy it... even just a simple example (all the files are there and they get loaded as far as i can see) – 72GM Jan 05 '16 at 18:17
  • Are you minifying source code when deploying? Can you try without minification. Some libraries do not work as expected when minified by an external script. – Dania Aug 06 '16 at 18:25

0 Answers0