0

I am using webpack + uglifyjs-webpack-plugin + ng-annotate-webpack-plugin in an angularjs app when doing a build everything seems to be working fine until I hit a piece of code that it is using $filter("currency") or $filter("date"). and the console throws the following error

Error: [$injector:unpr] Unknown provider: eProvider <- e <- $locale <- currencyFilter

Error: [$injector:unpr] Unknown provider: eProvider <- e <- $locale <- dateFilter

  • Can you post the component declaration where you're using `$filter`. This is usually caused because you aren't using string-injection based syntax, which causes issues when using uglify – Tyler May 01 '18 at 20:49
  • @Tyler thanks for replying I am using ng-annotate-webpack-plugin which takes care of that. Also the controller, services, directives there are all working fine the only problem is with the $filter("currency") and $filter("date") which are trying to get $locale service but this is happening inside the angularjs library – José Alejandro Salazar Marcano May 01 '18 at 21:13

1 Answers1

0

another possible reason is because you pack filter files in wrong order, try to pack filter files before the controller files which is using the filter.

Ao Li
  • 71
  • 1
  • 2