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

2
  • 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 Commented May 1, 2018 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 Commented May 1, 2018 at 21:13

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

These filters are part of the Angularjs library and all my libraries are bundle into a single file (vendor.bundle.js) which is the first script that it is loaded.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.