Google+

Wednesday, August 26, 2020

SOLVED : Angular 9 ERROR Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

In this article we review how to solve the Angular 9 ERROR 'Critical dependency: require function is used in a way in which dependencies cannot be statically extracted',   looking like this :






How to resolve the Angular 9 ERROR 'Critical dependency: require function is used in a way in which dependencies cannot be statically extracted' using Angular9


That;s an owfully bunch of errors all together to be solved, but that could be misleading. In effect, this errors ocurr just while adding an @Output() variable to your child component , like this :





If you pay closest attention, you'll notice that the reference added to the imports is that of protractor, and not the intended one, from @Angular/core :


That's the source of the whole bunch of errors depicted above.
Just change the import settings to that of the correct one, of @Angular/core :


Perform ng s --port 4200 --base-href   /yourwebsitename/  -o again, and get the success message :






That's All!!! 
Enjoy Angular.....

      by Carmel Schvartzman

כתב: כרמל שוורצמן



















No comments:

Post a Comment