Base solution for your next web application
Open Closed

Angular DI Error / NoProviderError #2813


User avatar
0
robdocherty created

When I first installed zero it was working fine and i was able to go through the step by step development guide and get the sample screen working. Later on, I had some issues adding new data access screens to the angular app so i removed both apps and went back to the original download. The app works OK but I cannot get anything new to work. I get the same error on the console every time and it's driving me nuts. To confirm, the standard admin pages are all working fine. However I can't get even the simple Phonebook page to load.. The error is always like per below. Can anyone help? rob

EXCEPTION: Uncaught (in promise): Error: DI Error Error: DI Error at NoProviderError.ZoneAwareError (<a class="postlink" href="http://localhost:4200/polyfills.bundle.js:6205:33">http://localhost:4200/polyfills.bundle.js:6205:33</a>) at NoProviderError.BaseError [as constructor] (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:37836:16">http://localhost:4200/vendor.bundle.js:37836:16</a>) at NoProviderError.AbstractProviderError [as constructor] (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:91873:16">http://localhost:4200/vendor.bundle.js:91873:16</a>) at new NoProviderError (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:91935:16">http://localhost:4200/vendor.bundle.js:91935:16</a>) at ReflectiveInjector_.throwOrNull (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129897:19">http://localhost:4200/vendor.bundle.js:129897:19</a>) at ReflectiveInjector.getByKeyDefault (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129936:25">http://localhost:4200/vendor.bundle.js:129936:25</a>) at ReflectiveInjector.getByKey (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129868:25">http://localhost:4200/vendor.bundle.js:129868:25</a>) at ReflectiveInjector.get (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129737:21">http://localhost:4200/vendor.bundle.js:129737:21</a>) at RootModuleInjector.NgModuleInjector.get (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:92809:52">http://localhost:4200/vendor.bundle.js:92809:52</a>) at CompiledTemplate.proxyViewClass.AppView.injectorGet (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:130672:45">http://localhost:4200/vendor.bundle.js:130672:45</a>) at CompiledTemplate.proxyViewClass.DebugAppView.injectorGet (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:131100:49">http://localhost:4200/vendor.bundle.js:131100:49</a>) at ElementInjector.get (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:130176:27">http://localhost:4200/vendor.bundle.js:130176:27</a>) at ReflectiveInjector_.getByKeyDefault (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129933:24">http://localhost:4200/vendor.bundle.js:129933:24</a>) at ReflectiveInjector.getByKey (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129868:25">http://localhost:4200/vendor.bundle.js:129868:25</a>) at ReflectiveInjector.get (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129737:21">http://localhost:4200/vendor.bundle.js:129737:21</a>)


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It is hard to understand problem from this error messge. Can you write which steps did you applied ?

    Thanks.

  • User Avatar
    0
    robdocherty created

    OK - i've now spent two full working days on this and it is driving me INSANE. no matter what I do, the Angular app works fine with all the existing entities and functions but as soon as i add any new proxy service, i get the error shown below in red. I have even checked the generated service proxies manually and cannot see any issue with them. There is nothing in the server logs and all api functions are working perfectly and fully tested with Postman.

    I can add a new angular page and so long as I hook it up to one of the existing services (such as Roles) it is great. As soon as I change it to one of the new services. Boom!

    I am absolutely at the end of my tether here guys. PLEASE HELP ASAP! I am so far behind now after spending so long on this. Your help greatly appreciated.

    I will send you a link to a complete download of both application directories.

    thanks Rob

    <span style="color:#FF0000">Unhandled Promise rejection: No provider for PersonServiceProxy! ; Zone: angular ; Task: Promise.then ; Value: NoProviderError Error: DI Error at NoProviderError.ZoneAwareError (<a class="postlink" href="http://localhost:4200/polyfills.bundle.js:6239:33">http://localhost:4200/polyfills.bundle.js:6239:33</a>) at NoProviderError.BaseError [as constructor] (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:37836:16">http://localhost:4200/vendor.bundle.js:37836:16</a>) at NoProviderError.AbstractProviderError [as constructor] (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:91952:16">http://localhost:4200/vendor.bundle.js:91952:16</a>) at new NoProviderError (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:92014:16">http://localhost:4200/vendor.bundle.js:92014:16</a>) at ReflectiveInjector_.throwOrNull (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129976:19">http://localhost:4200/vendor.bundle.js:129976:19</a>) at ReflectiveInjector.getByKeyDefault (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:130015:25">http://localhost:4200/vendor.bundle.js:130015:25</a>) at ReflectiveInjector.getByKey (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129947:25">http://localhost:4200/vendor.bundle.js:129947:25</a>) at ReflectiveInjector.get (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129816:21">http://localhost:4200/vendor.bundle.js:129816:21</a>) at RootModuleInjector.NgModuleInjector.get (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:92888:52">http://localhost:4200/vendor.bundle.js:92888:52</a>) at CompiledTemplate.proxyViewClass.AppView.injectorGet (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:130751:45">http://localhost:4200/vendor.bundle.js:130751:45</a>) at CompiledTemplate.proxyViewClass.DebugAppView.injectorGet (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:131179:49">http://localhost:4200/vendor.bundle.js:131179:49</a>) at ElementInjector.get (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:130255:27">http://localhost:4200/vendor.bundle.js:130255:27</a>) at ReflectiveInjector_.getByKeyDefault (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:130012:24">http://localhost:4200/vendor.bundle.js:130012:24</a>) at ReflectiveInjector.getByKey (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129947:25">http://localhost:4200/vendor.bundle.js:129947:25</a>) at ReflectiveInjector.get (<a class="postlink" href="http://localhost:4200/vendor.bundle.js:129816:21">http://localhost:4200/vendor.bundle.js:129816:21</a>)</span>

  • User Avatar
    0
    robdocherty created

    Hi - I just downloaded a fresh copy of the Angular 2 app and called it Acme.Phonebook. I followed the step-by-step guide religiously. All the way to the first db access for the GetPeople function. I got the exact same DI error again. All symptoms exactly per my descriptions above.

  • User Avatar
    0
    robdocherty created

    I've gone back through the dates. I am convinced this is an issue with the 3.3 release. I originally downloaded the step by step dev guide on March 8th - the 3.2 release. I did some initial learning and work on it and EVERYTHING WORKED FINE. The 3.3 release arrived just as I was about to start my project. So I downloaded VS2017 and downloaded the new software on March 14. Ever since then the Angular side of the application has been an exercise in frustration.

    <span style="color:#FF0000">CAN YOU GUYS PLEASE INVESTIGATE WITH URGENCY.</span> rob

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It seems like you didn't add "ApiServiceProxies.PersonServiceProxy" to providers array in service-proxy.module.ts file. This is explained in the documentation here <a class="postlink" href="https://aspnetzero.com/Documents/Developing-Step-By-Step-Angular#service-proxy-generation">https://aspnetzero.com/Documents/Develo ... generation</a> but it is easy to miss little details sometimes :).

    I hope you will have a better experience than the one you have until now with AspNet Zero.

    Thanks.

  • User Avatar
    0
    robdocherty created

    i'm embarassed to make such a rookie mistake. Love the support and the product. Cheers guys rob

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @robdocherty :).