angularangularjsangular-hybrid

Angular Hybrid: Error: [$injector:unpr] Unknown provider: eProvider <- e <- inputDirective with optimization enabled


I have migrated am AngularJS application to an hybrid AngularJS/Angular 17 application and got it working fine in dev and prod until I tried to enable the optimization from the angular.json file.

I have the error Error: [$injector:unpr] Unknown provider: eProvider <- e <- inputDirective.

It looks like to me that this directive is an internal one from AngularJs, so even if I have ensured that all my source code files are using the inline array dependencies, the app fails while using it.

I tried to use ng-annotate in a post-build script but it fails with the error

error: couldn't process source due to parse error
'import' and 'export' may appear only with 'sourceType: module' (1:0)

So it's like I have to use babel to transpile my ES6 code...

  1. Am I right to think this inputDirective is internal to AngularJS?
  2. If so, why am I facing this issue? Angular source code should be uglifyable, should it be?

Thank you in advance!


Solution

  • Actually there is a angular.module('name').directive('input', ...) in my project, and I wasn't aware of this naming convention.

    After updating it in order to use a string dependencies array, it works!

    Thanks folks for your help.